Initial import from local backup (Documents-Playground/pakerpale)

This commit is contained in:
jeonghwa
2026-07-03 05:27:29 +09:00
commit d918e2eddc
2971 changed files with 264195 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
import { convenient } from '../gradation';
export default {
gradation: convenient,
flavour: ['long-convenient', 'long'],
units: ['now', 'minute', 'hour', 'day', 'week', 'month', 'year']
};
//# sourceMappingURL=default.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../source/style/default.js"],"names":["convenient","gradation","flavour","units"],"mappings":"AAAA,SAASA,UAAT,QAA2B,cAA3B;AAEA,eACA;AACCC,EAAAA,SAAS,EAAED,UADZ;AAECE,EAAAA,OAAO,EAAE,CAAC,iBAAD,EAAoB,MAApB,CAFV;AAGCC,EAAAA,KAAK,EACL,CACC,KADD,EAEC,QAFD,EAGC,MAHD,EAIC,KAJD,EAKC,MALD,EAMC,OAND,EAOC,MAPD;AAJD,CADA","sourcesContent":["import { convenient } from '../gradation'\r\n\r\nexport default\r\n{\r\n\tgradation: convenient,\r\n\tflavour: ['long-convenient', 'long'],\r\n\tunits:\r\n\t[\r\n\t\t'now',\r\n\t\t'minute',\r\n\t\t'hour',\r\n\t\t'day',\r\n\t\t'week',\r\n\t\t'month',\r\n\t\t'year'\r\n\t]\r\n}"],"file":"default.js"}

View File

@@ -0,0 +1,9 @@
// A preset (style) is an object having shape
// `{ units, gradation, flavour, custom({ elapsed, time, date, now, locale }) }`.
//
// `date` parameter of `custom()` is not guaranteed to be set (can be inferred from `time`).
//
export { default as timeStyle } from './time';
export { default as twitterStyle } from './twitter';
export { default as defaultStyle } from './default';
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../source/style/index.js"],"names":["default","timeStyle","twitterStyle","defaultStyle"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,SAASA,OAAO,IAAIC,SAApB,QAAqC,QAArC;AACA,SAASD,OAAO,IAAIE,YAApB,QAAwC,WAAxC;AACA,SAASF,OAAO,IAAIG,YAApB,QAAwC,WAAxC","sourcesContent":["// A preset (style) is an object having shape\r\n// `{ units, gradation, flavour, custom({ elapsed, time, date, now, locale }) }`.\r\n//\r\n// `date` parameter of `custom()` is not guaranteed to be set (can be inferred from `time`).\r\n//\r\nexport { default as timeStyle } from './time'\r\nexport { default as twitterStyle } from './twitter'\r\nexport { default as defaultStyle } from './default'"],"file":"index.js"}

30
node_modules/javascript-time-ago/modules/style/time.js generated vendored Normal file
View File

@@ -0,0 +1,30 @@
import { convenient } from '../gradation'; // Similar to the default style but with "ago" omitted.
//
// just now
// 5 minutes
// 10 minutes
// 15 minutes
// 20 minutes
// an hour
// 2 hours
// …
// 20 hours
// 1 day
// 2 days
// a week
// 2 weeks
// 3 weeks
// a month
// 2 months
// 3 months
// 4 months
// a year
// 2 years
//
export default {
gradation: convenient,
flavour: 'long-time',
units: ['now', 'minute', 'hour', 'day', 'week', 'month', 'year']
};
//# sourceMappingURL=time.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../source/style/time.js"],"names":["convenient","gradation","flavour","units"],"mappings":"AAAA,SAASA,UAAT,QAA2B,cAA3B,C,CAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eACA;AACCC,EAAAA,SAAS,EAAED,UADZ;AAECE,EAAAA,OAAO,EAAE,WAFV;AAGCC,EAAAA,KAAK,EACL,CACC,KADD,EAEC,QAFD,EAGC,MAHD,EAIC,KAJD,EAKC,MALD,EAMC,OAND,EAOC,MAPD;AAJD,CADA","sourcesContent":["import { convenient } from '../gradation'\r\n\r\n// Similar to the default style but with \"ago\" omitted.\r\n//\r\n// just now\r\n// 5 minutes\r\n// 10 minutes\r\n// 15 minutes\r\n// 20 minutes\r\n// an hour\r\n// 2 hours\r\n// …\r\n// 20 hours\r\n// 1 day\r\n// 2 days\r\n// a week\r\n// 2 weeks\r\n// 3 weeks\r\n// a month\r\n// 2 months\r\n// 3 months\r\n// 4 months\r\n// a year\r\n// 2 years\r\n//\r\nexport default\r\n{\r\n\tgradation: convenient,\r\n\tflavour: 'long-time',\r\n\tunits:\r\n\t[\r\n\t\t'now',\r\n\t\t'minute',\r\n\t\t'hour',\r\n\t\t'day',\r\n\t\t'week',\r\n\t\t'month',\r\n\t\t'year'\r\n\t]\r\n}"],"file":"time.js"}

View File

@@ -0,0 +1,11 @@
import timeStyle from './time';
import { convenientGradationTest } from '../JavascriptTimeAgo.test';
describe('"time" style', function () {
it('should format "time" style relative time (English)', function () {
convenientGradationTest(['just now', '1 minute', '2 minutes', '5 minutes', '10 minutes', '15 minutes', '20 minutes', '25 minutes', '30 minutes', '35 minutes', '40 minutes', '45 minutes', '50 minutes', '1 hour', '2 hours', '3 hours', '4 hours', '5 hours', '6 hours', '7 hours', '8 hours', '9 hours', '10 hours', '11 hours', '12 hours', '13 hours', '14 hours', '15 hours', '16 hours', '17 hours', '18 hours', '19 hours', '20 hours', '1 day', '2 days', '3 days', '4 days', '5 days', '1 week', '2 weeks', '3 weeks', '1 month', '2 months', '3 months', '4 months', '5 months', '6 months', '7 months', '8 months', '9 months', '9 months', '10 months', '1 year', '2 years', '3 years', '100 years'], 'en-US', timeStyle);
});
it('should format "time" style relative time (Russian)', function () {
convenientGradationTest(['только что', '1 минута', '2 минуты', '5 минут', '10 минут', '15 минут', '20 минут', '25 минут', '30 минут', '35 минут', '40 минут', '45 минут', '50 минут', '1 час', '2 часа', '3 часа', '4 часа', '5 часов', '6 часов', '7 часов', '8 часов', '9 часов', '10 часов', '11 часов', '12 часов', '13 часов', '14 часов', '15 часов', '16 часов', '17 часов', '18 часов', '19 часов', '20 часов', '1 день', '2 дня', '3 дня', '4 дня', '5 дней', '1 неделю', '2 недели', '3 недели', '1 месяц', '2 месяца', '3 месяца', '4 месяца', '5 месяцев', '6 месяцев', '7 месяцев', '8 месяцев', '9 месяцев', '9 месяцев', '10 месяцев', '1 год', '2 года', '3 года', '100 лет'], 'ru-RU', timeStyle);
});
});
//# sourceMappingURL=time.test.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,103 @@
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
import { canonical, day, hour, getStep, getDate } from '../gradation';
import { intlDateTimeFormatSupported } from '../locale'; // A cache for `Intl.DateTimeFormat` twitter formatters
// for various locales (is a global variable).
var formatters = {}; // Twitter style relative time formatting.
// ("1m", "2h", "Mar 3", "Apr 4, 2012").
// Seconds, minutes and hours are shown relatively,
// and other intervals can be shown using full date format.
export default {
// Twitter gradation is derived from "canonical" gradation
// adjusting its "minute" `threshold` to be 45.
gradation: [// Minutes
_objectSpread({}, getStep(canonical, 'minute'), {
threshold: 45
}), // Hours
getStep(canonical, 'hour'), // If `date` and `now` happened the same year,
// then only output month and day.
{
threshold: day - 0.5 * hour,
format: function format(value, locale) {
// Whether can use `Intl.DateTimeFormat`.
// If `Intl` is not available,
// or the locale is not supported,
// then don't override the default labels.
/* istanbul ignore if */
if (!intlDateTimeFormatSupported()) {
return;
}
/* istanbul ignore else */
if (!formatters[locale]) {
formatters[locale] = {};
}
/* istanbul ignore else */
if (!formatters[locale].this_year) {
// "Apr 11" (MMMd)
formatters[locale].this_year = new Intl.DateTimeFormat(locale, {
month: 'short',
day: 'numeric'
});
} // Output month and day.
return formatters[locale].this_year.format(getDate(value));
}
}, // If `date` and `now` happened in defferent years,
// then output day, month and year.
{
threshold: function threshold(now, future) {
if (future) {
// Jan 1st 00:00 of the next year.
var nextYear = new Date(new Date(now).getFullYear() + 1, 0);
return (nextYear.getTime() - now) / 1000;
} else {
// Jan 1st of the current year.
var thisYear = new Date(new Date(now).getFullYear(), 0);
return (now - thisYear.getTime()) / 1000;
}
},
format: function format(value, locale) {
// Whether can use `Intl.DateTimeFormat`.
// If `Intl` is not available,
// or the locale is not supported,
// then don't override the default labels.
/* istanbul ignore if */
if (!intlDateTimeFormatSupported()) {
return;
}
/* istanbul ignore if */
if (!formatters[locale]) {
formatters[locale] = {};
}
/* istanbul ignore else */
if (!formatters[locale].other) {
// "Apr 11, 2017" (yMMMd)
formatters[locale].other = new Intl.DateTimeFormat(locale, {
year: 'numeric',
month: 'short',
day: 'numeric'
});
} // Output day, month and year.
return formatters[locale].other.format(getDate(value));
}
}],
flavour: ['tiny', 'short-time', 'narrow', 'short']
};
//# sourceMappingURL=twitter.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,80 @@
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
import twitterStyle from './twitter';
import JavascriptTimeAgo from '../JavascriptTimeAgo';
import { day, month, year } from '../gradation';
describe('"twitter" style', function () {
it('should fallback from "tiny" to "narrow" for Twitter style for autogenerated locales', function () {
var timeAgo = new JavascriptTimeAgo('de');
timeAgo.format(Date.now() - 3 * 60 * 60 * 1000, 'twitter').should.equal('vor 3 Std.');
});
it('should format Twitter style relative time (English)', function () {
var timeAgo = new JavascriptTimeAgo('en');
var now = new Date(2016, 3, 10, 22, 59).getTime();
var elapsed = function elapsed(time) {
return timeAgo.format(now - time * 1000, _objectSpread({
now: now
}, twitterStyle));
};
elapsed(0).should.equal('');
elapsed(44.9).should.equal('');
elapsed(45.1).should.equal('1m');
elapsed(1.49 * 60).should.equal('1m');
elapsed(1.51 * 60).should.equal('2m');
elapsed(2.49 * 60).should.equal('2m');
elapsed(2.51 * 60).should.equal('3m'); // …
elapsed(59.49 * 60).should.equal('59m');
elapsed(59.51 * 60).should.equal('1h');
elapsed(1.49 * 60 * 60).should.equal('1h');
elapsed(1.51 * 60 * 60).should.equal('2h');
elapsed(2.49 * 60 * 60).should.equal('2h');
elapsed(2.51 * 60 * 60).should.equal('3h'); // …
elapsed(23.49 * 60 * 60).should.equal('23h');
elapsed(day + 2 * 60 + 60 * 60).should.equal('Apr 9'); // …
// "month" is an approximation.
elapsed(month * 3).should.equal('Jan 10');
elapsed(month * 4).should.equal('Dec 11, 2015');
elapsed(year).should.equal('Apr 11, 2015'); // Test future dates.
// "month" is an approximation.
elapsed(-1 * month * 8).should.equal('Dec 10');
elapsed(-1 * month * 9).should.equal('Jan 9, 2017');
});
it('should format Twitter style relative time (Russian)', function () {
var timeAgo = new JavascriptTimeAgo('ru');
var now = new Date(2016, 3, 10, 22, 59).getTime();
var elapsed = function elapsed(time) {
return timeAgo.format(now - time * 1000, _objectSpread({
now: now
}, twitterStyle));
};
elapsed(45.1).should.equal('1м');
elapsed(59.51 * 60).should.equal('1ч');
elapsed(day + 62 * 60).should.equal('9 апр.');
elapsed(year).should.equal('11 апр. 2015 г.');
});
it('should format Twitter style relative time (Korean)', function () {
var timeAgo = new JavascriptTimeAgo('ko');
var now = new Date(2016, 3, 10, 22, 59).getTime();
var elapsed = function elapsed(time) {
return timeAgo.format(now - time * 1000, _objectSpread({
now: now
}, twitterStyle));
};
elapsed(45.1).should.equal('1분');
elapsed(59.51 * 60).should.equal('1시간'); // elapsed(day + 62 * 60).should.equal('9 апр.')
// elapsed(year).should.equal('11 апр. 2015 г.')
});
});
//# sourceMappingURL=twitter.test.js.map

File diff suppressed because one or more lines are too long