@astryxdesign/core 0.7.2-canary.374b53a → 0.7.2-canary.4284442
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Markdown/plugins/frontmatter.d.ts.map +1 -1
- package/dist/Markdown/plugins/frontmatter.js +7 -3
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +17 -1
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +17 -1
- package/locales/en.json +64 -0
- package/locales/pseudo.json +48 -0
- package/package.json +3 -3
- package/src/Markdown/plugins/frontmatter.test.tsx +25 -0
- package/src/Markdown/plugins/frontmatter.ts +7 -3
- package/src/i18n/generated-locales/en.generated.ts +16 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +16 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frontmatter.d.ts","sourceRoot":"","sources":["../../../src/Markdown/plugins/frontmatter.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAKL,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EAEzB,MAAM,YAAY,CAAC;AAMpB,KAAK,iBAAiB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAO1D,MAAM,WAAW,0BAA0B,CACzC,QAAQ,SAAS,kBAAkB;IAEnC,4CAA4C;IAC5C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,wEAAwE;IACxE,QAAQ,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,QAAQ,CAAC;CACzD;AAED,MAAM,MAAM,8BAA8B,CACxC,QAAQ,SAAS,kBAAkB,IAEjC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAC,GACzB;IAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;CAAC,GAC1B;IACE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;CAC7B,CAAC;AAEN,MAAM,WAAW,mBAAmB,CAAC,QAAQ,SAAS,kBAAkB;IACtE,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAC5C,KAAK,CACH,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,OAAO,GAChB,8BAA8B,CAAC,QAAQ,CAAC,CAAC;IAC5C,WAAW,CACT,QAAQ,EAAE,eAAe,CAAC,qBAAqB,CAAC,GAC/C,QAAQ,GAAG,SAAS,CAAC;CACzB;
|
|
1
|
+
{"version":3,"file":"frontmatter.d.ts","sourceRoot":"","sources":["../../../src/Markdown/plugins/frontmatter.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAKL,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EAEzB,MAAM,YAAY,CAAC;AAMpB,KAAK,iBAAiB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAO1D,MAAM,WAAW,0BAA0B,CACzC,QAAQ,SAAS,kBAAkB;IAEnC,4CAA4C;IAC5C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,wEAAwE;IACxE,QAAQ,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,QAAQ,CAAC;CACzD;AAED,MAAM,MAAM,8BAA8B,CACxC,QAAQ,SAAS,kBAAkB,IAEjC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAC,GACzB;IAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;CAAC,GAC1B;IACE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;CAC7B,CAAC;AAEN,MAAM,WAAW,mBAAmB,CAAC,QAAQ,SAAS,kBAAkB;IACtE,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAC5C,KAAK,CACH,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,OAAO,GAChB,8BAA8B,CAAC,QAAQ,CAAC,CAAC;IAC5C,WAAW,CACT,QAAQ,EAAE,eAAe,CAAC,qBAAqB,CAAC,GAC/C,QAAQ,GAAG,SAAS,CAAC;CACzB;AAsED,wBAAgB,yBAAyB,CAAC,QAAQ,SAAS,kBAAkB,EAC3E,OAAO,EAAE,0BAA0B,CAAC,QAAQ,CAAC,GAC5C,mBAAmB,CAAC,QAAQ,CAAC,CAoE/B"}
|
|
@@ -35,20 +35,24 @@ function readFrontmatter(source) {
|
|
|
35
35
|
status: 'defer'
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
const
|
|
38
|
+
const entries = new Map();
|
|
39
39
|
for (const line of body.slice(0, close.index).split(/\r?\n/)) {
|
|
40
40
|
if (line.trim() === '') {
|
|
41
41
|
continue;
|
|
42
42
|
}
|
|
43
43
|
const separator = line.indexOf(':');
|
|
44
44
|
const key = line.slice(0, separator).trim();
|
|
45
|
-
if (separator <= 0 || key === '' ||
|
|
45
|
+
if (separator <= 0 || key === '' || entries.has(key)) {
|
|
46
46
|
return {
|
|
47
47
|
status: 'none'
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
|
-
|
|
50
|
+
entries.set(key, line.slice(separator + 1).trim());
|
|
51
51
|
}
|
|
52
|
+
// A plain object, so a parser that returns the record unchanged passes the
|
|
53
|
+
// JSON-like metadata check. `fromEntries` defines every key as an own data
|
|
54
|
+
// property, so a field named `__proto__` stays a field.
|
|
55
|
+
const fields = Object.fromEntries(entries);
|
|
52
56
|
let end = openingLength + close.index + close[0].length;
|
|
53
57
|
if (source.startsWith('\r\n', end)) {
|
|
54
58
|
end += 2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.generated.d.ts","sourceRoot":"","sources":["../../../src/i18n/generated-locales/en.generated.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,QAAA,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"en.generated.d.ts","sourceRoot":"","sources":["../../../src/i18n/generated-locales/en.generated.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,QAAA,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA0epD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -436,6 +436,22 @@ const runtimeCatalog = {
|
|
|
436
436
|
'@astryx.transferList.announceSearchResults': '{count, number} {count, plural, one {item} other {items}} found.',
|
|
437
437
|
'@astryx.transferListSelector.apply': 'Apply',
|
|
438
438
|
'@astryx.transferListSelector.cancel': 'Cancel',
|
|
439
|
-
'@astryx.transferListSelector.triggerLabel': '{count, number} selected'
|
|
439
|
+
'@astryx.transferListSelector.triggerLabel': '{count, number} selected',
|
|
440
|
+
'@astryx.emojiPicker.label': 'Emoji',
|
|
441
|
+
'@astryx.emojiPicker.searchLabel': 'Search emoji',
|
|
442
|
+
'@astryx.emojiPicker.frequentlyUsed': 'Frequently used',
|
|
443
|
+
'@astryx.emojiPicker.searchResults': 'Search results',
|
|
444
|
+
'@astryx.emojiPicker.noResults': 'No emoji match “{query}”',
|
|
445
|
+
'@astryx.emojiPicker.loading': 'Loading emoji',
|
|
446
|
+
'@astryx.emojiPicker.loadFailed': "More emoji couldn't be loaded.",
|
|
447
|
+
'@astryx.emojiPicker.groupSmileysEmotion': 'Smileys & emotion',
|
|
448
|
+
'@astryx.emojiPicker.groupPeopleBody': 'People & body',
|
|
449
|
+
'@astryx.emojiPicker.groupAnimalsNature': 'Animals & nature',
|
|
450
|
+
'@astryx.emojiPicker.groupFoodDrink': 'Food & drink',
|
|
451
|
+
'@astryx.emojiPicker.groupTravelPlaces': 'Travel & places',
|
|
452
|
+
'@astryx.emojiPicker.groupActivities': 'Activities',
|
|
453
|
+
'@astryx.emojiPicker.groupObjects': 'Objects',
|
|
454
|
+
'@astryx.emojiPicker.groupSymbols': 'Symbols',
|
|
455
|
+
'@astryx.emojiPicker.groupFlags': 'Flags'
|
|
440
456
|
};
|
|
441
457
|
export default runtimeCatalog;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pseudo.generated.d.ts","sourceRoot":"","sources":["../../../src/i18n/generated-locales/pseudo.generated.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,QAAA,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"pseudo.generated.d.ts","sourceRoot":"","sources":["../../../src/i18n/generated-locales/pseudo.generated.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,QAAA,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAmfpD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -436,6 +436,22 @@ const runtimeCatalog = {
|
|
|
436
436
|
'@astryx.transferList.announceSearchResults': '⟦{count, number} {count, plural, one {item} other {items}} ƒóúñð.⟧',
|
|
437
437
|
'@astryx.transferListSelector.apply': '⟦Àþþłý⟧',
|
|
438
438
|
'@astryx.transferListSelector.cancel': '⟦Çàñçéł⟧',
|
|
439
|
-
'@astryx.transferListSelector.triggerLabel': '⟦{count, number} šéłéçţéð⟧'
|
|
439
|
+
'@astryx.transferListSelector.triggerLabel': '⟦{count, number} šéłéçţéð⟧',
|
|
440
|
+
'@astryx.emojiPicker.label': '⟦Éɱóĵí⟧',
|
|
441
|
+
'@astryx.emojiPicker.searchLabel': '⟦Šéàřçĥ éɱóĵí⟧',
|
|
442
|
+
'@astryx.emojiPicker.frequentlyUsed': '⟦Ƒřéɋúéñţłý úšéð⟧',
|
|
443
|
+
'@astryx.emojiPicker.searchResults': '⟦Šéàřçĥ řéšúłţš⟧',
|
|
444
|
+
'@astryx.emojiPicker.noResults': '⟦Ñó éɱóĵí ɱàţçĥ “{query}”⟧',
|
|
445
|
+
'@astryx.emojiPicker.loading': '⟦Łóàðíñĝ éɱóĵí⟧',
|
|
446
|
+
'@astryx.emojiPicker.loadFailed': "⟦Ṁóřé éɱóĵí çóúłðñ'ţ ƀé łóàðéð.⟧",
|
|
447
|
+
'@astryx.emojiPicker.groupSmileysEmotion': '⟦Šɱíłéýš & éɱóţíóñ⟧',
|
|
448
|
+
'@astryx.emojiPicker.groupPeopleBody': '⟦Þéóþłé & ƀóðý⟧',
|
|
449
|
+
'@astryx.emojiPicker.groupAnimalsNature': '⟦Àñíɱàłš & ñàţúřé⟧',
|
|
450
|
+
'@astryx.emojiPicker.groupFoodDrink': '⟦Ƒóóð & ðříñķ⟧',
|
|
451
|
+
'@astryx.emojiPicker.groupTravelPlaces': '⟦Ţřàṽéł & þłàçéš⟧',
|
|
452
|
+
'@astryx.emojiPicker.groupActivities': '⟦Àçţíṽíţíéš⟧',
|
|
453
|
+
'@astryx.emojiPicker.groupObjects': '⟦Óƀĵéçţš⟧',
|
|
454
|
+
'@astryx.emojiPicker.groupSymbols': '⟦Šýɱƀółš⟧',
|
|
455
|
+
'@astryx.emojiPicker.groupFlags': '⟦Ƒłàĝš⟧'
|
|
440
456
|
};
|
|
441
457
|
export default runtimeCatalog;
|
package/locales/en.json
CHANGED
|
@@ -1718,5 +1718,69 @@
|
|
|
1718
1718
|
"@astryx.transferListSelector.triggerLabel": {
|
|
1719
1719
|
"defaultMessage": "{count, number} selected",
|
|
1720
1720
|
"description": "Default summary on the closed trigger of a lab TransferListSelector, stating how many options are currently chosen. Consumers usually override this with a domain phrase (e.g. \"7 columns\")."
|
|
1721
|
+
},
|
|
1722
|
+
"@astryx.emojiPicker.label": {
|
|
1723
|
+
"defaultMessage": "Emoji",
|
|
1724
|
+
"description": "Default accessible name of the scrolling list of emoji in a lab EmojiPicker, and the footer text when no emoji is hovered or focused."
|
|
1725
|
+
},
|
|
1726
|
+
"@astryx.emojiPicker.searchLabel": {
|
|
1727
|
+
"defaultMessage": "Search emoji",
|
|
1728
|
+
"description": "Default placeholder and hidden label of the search field of a lab EmojiPicker."
|
|
1729
|
+
},
|
|
1730
|
+
"@astryx.emojiPicker.frequentlyUsed": {
|
|
1731
|
+
"defaultMessage": "Frequently used",
|
|
1732
|
+
"description": "Heading of the first group in a lab EmojiPicker, the host's frequent or recent emoji."
|
|
1733
|
+
},
|
|
1734
|
+
"@astryx.emojiPicker.searchResults": {
|
|
1735
|
+
"defaultMessage": "Search results",
|
|
1736
|
+
"description": "Heading of the single group a lab EmojiPicker shows while its search field has text."
|
|
1737
|
+
},
|
|
1738
|
+
"@astryx.emojiPicker.noResults": {
|
|
1739
|
+
"defaultMessage": "No emoji match “{query}”",
|
|
1740
|
+
"description": "Shown in a lab EmojiPicker when no emoji name or keyword matches the search. `query` is the search text."
|
|
1741
|
+
},
|
|
1742
|
+
"@astryx.emojiPicker.loading": {
|
|
1743
|
+
"defaultMessage": "Loading emoji",
|
|
1744
|
+
"description": "Accessible name of the spinner a lab EmojiPicker shows while its bundled emoji set loads."
|
|
1745
|
+
},
|
|
1746
|
+
"@astryx.emojiPicker.loadFailed": {
|
|
1747
|
+
"defaultMessage": "More emoji couldn't be loaded.",
|
|
1748
|
+
"description": "Shown in a lab EmojiPicker when its bundled emoji set failed to load; the frequent emoji still show."
|
|
1749
|
+
},
|
|
1750
|
+
"@astryx.emojiPicker.groupSmileysEmotion": {
|
|
1751
|
+
"defaultMessage": "Smileys & emotion",
|
|
1752
|
+
"description": "Heading of the Unicode CLDR emoji group of faces and emotions in a lab EmojiPicker."
|
|
1753
|
+
},
|
|
1754
|
+
"@astryx.emojiPicker.groupPeopleBody": {
|
|
1755
|
+
"defaultMessage": "People & body",
|
|
1756
|
+
"description": "Heading of the Unicode CLDR emoji group of people, gestures, and body parts in a lab EmojiPicker."
|
|
1757
|
+
},
|
|
1758
|
+
"@astryx.emojiPicker.groupAnimalsNature": {
|
|
1759
|
+
"defaultMessage": "Animals & nature",
|
|
1760
|
+
"description": "Heading of the Unicode CLDR emoji group of animals and plants in a lab EmojiPicker."
|
|
1761
|
+
},
|
|
1762
|
+
"@astryx.emojiPicker.groupFoodDrink": {
|
|
1763
|
+
"defaultMessage": "Food & drink",
|
|
1764
|
+
"description": "Heading of the Unicode CLDR emoji group of food and drink in a lab EmojiPicker."
|
|
1765
|
+
},
|
|
1766
|
+
"@astryx.emojiPicker.groupTravelPlaces": {
|
|
1767
|
+
"defaultMessage": "Travel & places",
|
|
1768
|
+
"description": "Heading of the Unicode CLDR emoji group of places, vehicles, and weather in a lab EmojiPicker."
|
|
1769
|
+
},
|
|
1770
|
+
"@astryx.emojiPicker.groupActivities": {
|
|
1771
|
+
"defaultMessage": "Activities",
|
|
1772
|
+
"description": "Heading of the Unicode CLDR emoji group of sports, games, and events in a lab EmojiPicker."
|
|
1773
|
+
},
|
|
1774
|
+
"@astryx.emojiPicker.groupObjects": {
|
|
1775
|
+
"defaultMessage": "Objects",
|
|
1776
|
+
"description": "Heading of the Unicode CLDR emoji group of everyday objects in a lab EmojiPicker."
|
|
1777
|
+
},
|
|
1778
|
+
"@astryx.emojiPicker.groupSymbols": {
|
|
1779
|
+
"defaultMessage": "Symbols",
|
|
1780
|
+
"description": "Heading of the Unicode CLDR emoji group of signs and symbols in a lab EmojiPicker."
|
|
1781
|
+
},
|
|
1782
|
+
"@astryx.emojiPicker.groupFlags": {
|
|
1783
|
+
"defaultMessage": "Flags",
|
|
1784
|
+
"description": "Heading of the Unicode CLDR emoji group of flags in a lab EmojiPicker."
|
|
1721
1785
|
}
|
|
1722
1786
|
}
|
package/locales/pseudo.json
CHANGED
|
@@ -1288,5 +1288,53 @@
|
|
|
1288
1288
|
},
|
|
1289
1289
|
"@astryx.transferListSelector.triggerLabel": {
|
|
1290
1290
|
"defaultMessage": "⟦{count, number} šéłéçţéð⟧"
|
|
1291
|
+
},
|
|
1292
|
+
"@astryx.emojiPicker.label": {
|
|
1293
|
+
"defaultMessage": "⟦Éɱóĵí⟧"
|
|
1294
|
+
},
|
|
1295
|
+
"@astryx.emojiPicker.searchLabel": {
|
|
1296
|
+
"defaultMessage": "⟦Šéàřçĥ éɱóĵí⟧"
|
|
1297
|
+
},
|
|
1298
|
+
"@astryx.emojiPicker.frequentlyUsed": {
|
|
1299
|
+
"defaultMessage": "⟦Ƒřéɋúéñţłý úšéð⟧"
|
|
1300
|
+
},
|
|
1301
|
+
"@astryx.emojiPicker.searchResults": {
|
|
1302
|
+
"defaultMessage": "⟦Šéàřçĥ řéšúłţš⟧"
|
|
1303
|
+
},
|
|
1304
|
+
"@astryx.emojiPicker.noResults": {
|
|
1305
|
+
"defaultMessage": "⟦Ñó éɱóĵí ɱàţçĥ “{query}”⟧"
|
|
1306
|
+
},
|
|
1307
|
+
"@astryx.emojiPicker.loading": {
|
|
1308
|
+
"defaultMessage": "⟦Łóàðíñĝ éɱóĵí⟧"
|
|
1309
|
+
},
|
|
1310
|
+
"@astryx.emojiPicker.loadFailed": {
|
|
1311
|
+
"defaultMessage": "⟦Ṁóřé éɱóĵí çóúłðñ'ţ ƀé łóàðéð.⟧"
|
|
1312
|
+
},
|
|
1313
|
+
"@astryx.emojiPicker.groupSmileysEmotion": {
|
|
1314
|
+
"defaultMessage": "⟦Šɱíłéýš & éɱóţíóñ⟧"
|
|
1315
|
+
},
|
|
1316
|
+
"@astryx.emojiPicker.groupPeopleBody": {
|
|
1317
|
+
"defaultMessage": "⟦Þéóþłé & ƀóðý⟧"
|
|
1318
|
+
},
|
|
1319
|
+
"@astryx.emojiPicker.groupAnimalsNature": {
|
|
1320
|
+
"defaultMessage": "⟦Àñíɱàłš & ñàţúřé⟧"
|
|
1321
|
+
},
|
|
1322
|
+
"@astryx.emojiPicker.groupFoodDrink": {
|
|
1323
|
+
"defaultMessage": "⟦Ƒóóð & ðříñķ⟧"
|
|
1324
|
+
},
|
|
1325
|
+
"@astryx.emojiPicker.groupTravelPlaces": {
|
|
1326
|
+
"defaultMessage": "⟦Ţřàṽéł & þłàçéš⟧"
|
|
1327
|
+
},
|
|
1328
|
+
"@astryx.emojiPicker.groupActivities": {
|
|
1329
|
+
"defaultMessage": "⟦Àçţíṽíţíéš⟧"
|
|
1330
|
+
},
|
|
1331
|
+
"@astryx.emojiPicker.groupObjects": {
|
|
1332
|
+
"defaultMessage": "⟦Óƀĵéçţš⟧"
|
|
1333
|
+
},
|
|
1334
|
+
"@astryx.emojiPicker.groupSymbols": {
|
|
1335
|
+
"defaultMessage": "⟦Šýɱƀółš⟧"
|
|
1336
|
+
},
|
|
1337
|
+
"@astryx.emojiPicker.groupFlags": {
|
|
1338
|
+
"defaultMessage": "⟦Ƒłàĝš⟧"
|
|
1291
1339
|
}
|
|
1292
1340
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/core",
|
|
3
|
-
"version": "0.7.2-canary.
|
|
3
|
+
"version": "0.7.2-canary.4284442",
|
|
4
4
|
"displayName": "Astryx Core",
|
|
5
5
|
"description": "The component library. Accessible, themeable React components with built-in spacing, dark mode, and StyleX styling.",
|
|
6
6
|
"author": "Meta Open Source",
|
|
@@ -787,8 +787,8 @@
|
|
|
787
787
|
"react-dom": ">=19.0.0"
|
|
788
788
|
},
|
|
789
789
|
"devDependencies": {
|
|
790
|
-
"@astryxdesign/a11y-spec": "0.7.2-canary.
|
|
791
|
-
"@astryxdesign/cli": "0.7.2-canary.
|
|
790
|
+
"@astryxdesign/a11y-spec": "0.7.2-canary.4284442",
|
|
791
|
+
"@astryxdesign/cli": "0.7.2-canary.4284442",
|
|
792
792
|
"@babel/cli": "^7.29.7",
|
|
793
793
|
"@babel/core": "^7.29.7",
|
|
794
794
|
"@babel/preset-react": "^7.29.7",
|
|
@@ -117,6 +117,31 @@ describe('createMarkdownFrontmatter', () => {
|
|
|
117
117
|
).not.toThrow();
|
|
118
118
|
});
|
|
119
119
|
|
|
120
|
+
it('accepts the decoded fields record as metadata (identity parse)', () => {
|
|
121
|
+
const fields = createMarkdownFrontmatter({
|
|
122
|
+
name: 'fields',
|
|
123
|
+
parse: record => record,
|
|
124
|
+
});
|
|
125
|
+
const source = '---\ntitle: Release notes\n__proto__: kept\n---\n# Shipped';
|
|
126
|
+
|
|
127
|
+
const parsed = fields.parse(source);
|
|
128
|
+
expect(parsed).toEqual({
|
|
129
|
+
status: 'match',
|
|
130
|
+
contentStart: source.indexOf('# Shipped'),
|
|
131
|
+
metadata: {title: 'Release notes', ['__proto__']: 'kept'},
|
|
132
|
+
});
|
|
133
|
+
if (parsed.status !== 'match') {
|
|
134
|
+
throw new Error('expected a frontmatter match');
|
|
135
|
+
}
|
|
136
|
+
// A field named like a prototype key stays an ordinary own field.
|
|
137
|
+
expect(Object.hasOwn(parsed.metadata, '__proto__')).toBe(true);
|
|
138
|
+
expect(Object.getPrototypeOf(parsed.metadata)).toBe(Object.prototype);
|
|
139
|
+
|
|
140
|
+
const root = parseMarkdownAst(source, {plugins: [fields.plugin]});
|
|
141
|
+
expect(fields.getMetadata(root)).toEqual(parsed.metadata);
|
|
142
|
+
expect(JSON.stringify(root)).not.toContain('title: Release notes');
|
|
143
|
+
});
|
|
144
|
+
|
|
120
145
|
it('returns a transform plugin that composes in the ordered pipeline', () => {
|
|
121
146
|
expectTypeOf<MarkdownTransform>().toBeFunction();
|
|
122
147
|
const root = parseMarkdownAst(SOURCE, {plugins: [documentMetadata.plugin]});
|
|
@@ -104,18 +104,22 @@ function readFrontmatter(source: string):
|
|
|
104
104
|
if (close == null) {
|
|
105
105
|
return {status: 'defer'};
|
|
106
106
|
}
|
|
107
|
-
const
|
|
107
|
+
const entries = new Map<string, string>();
|
|
108
108
|
for (const line of body.slice(0, close.index).split(/\r?\n/)) {
|
|
109
109
|
if (line.trim() === '') {
|
|
110
110
|
continue;
|
|
111
111
|
}
|
|
112
112
|
const separator = line.indexOf(':');
|
|
113
113
|
const key = line.slice(0, separator).trim();
|
|
114
|
-
if (separator <= 0 || key === '' ||
|
|
114
|
+
if (separator <= 0 || key === '' || entries.has(key)) {
|
|
115
115
|
return {status: 'none'};
|
|
116
116
|
}
|
|
117
|
-
|
|
117
|
+
entries.set(key, line.slice(separator + 1).trim());
|
|
118
118
|
}
|
|
119
|
+
// A plain object, so a parser that returns the record unchanged passes the
|
|
120
|
+
// JSON-like metadata check. `fromEntries` defines every key as an own data
|
|
121
|
+
// property, so a field named `__proto__` stays a field.
|
|
122
|
+
const fields: Record<string, string> = Object.fromEntries(entries);
|
|
119
123
|
let end = openingLength + close.index + close[0].length;
|
|
120
124
|
if (source.startsWith('\r\n', end)) {
|
|
121
125
|
end += 2;
|
|
@@ -480,6 +480,22 @@ const runtimeCatalog: Readonly<Record<string, string>> = {
|
|
|
480
480
|
'@astryx.transferListSelector.apply': 'Apply',
|
|
481
481
|
'@astryx.transferListSelector.cancel': 'Cancel',
|
|
482
482
|
'@astryx.transferListSelector.triggerLabel': '{count, number} selected',
|
|
483
|
+
'@astryx.emojiPicker.label': 'Emoji',
|
|
484
|
+
'@astryx.emojiPicker.searchLabel': 'Search emoji',
|
|
485
|
+
'@astryx.emojiPicker.frequentlyUsed': 'Frequently used',
|
|
486
|
+
'@astryx.emojiPicker.searchResults': 'Search results',
|
|
487
|
+
'@astryx.emojiPicker.noResults': 'No emoji match “{query}”',
|
|
488
|
+
'@astryx.emojiPicker.loading': 'Loading emoji',
|
|
489
|
+
'@astryx.emojiPicker.loadFailed': "More emoji couldn't be loaded.",
|
|
490
|
+
'@astryx.emojiPicker.groupSmileysEmotion': 'Smileys & emotion',
|
|
491
|
+
'@astryx.emojiPicker.groupPeopleBody': 'People & body',
|
|
492
|
+
'@astryx.emojiPicker.groupAnimalsNature': 'Animals & nature',
|
|
493
|
+
'@astryx.emojiPicker.groupFoodDrink': 'Food & drink',
|
|
494
|
+
'@astryx.emojiPicker.groupTravelPlaces': 'Travel & places',
|
|
495
|
+
'@astryx.emojiPicker.groupActivities': 'Activities',
|
|
496
|
+
'@astryx.emojiPicker.groupObjects': 'Objects',
|
|
497
|
+
'@astryx.emojiPicker.groupSymbols': 'Symbols',
|
|
498
|
+
'@astryx.emojiPicker.groupFlags': 'Flags',
|
|
483
499
|
};
|
|
484
500
|
|
|
485
501
|
export default runtimeCatalog;
|
|
@@ -489,6 +489,22 @@ const runtimeCatalog: Readonly<Record<string, string>> = {
|
|
|
489
489
|
'@astryx.transferListSelector.apply': '⟦Àþþłý⟧',
|
|
490
490
|
'@astryx.transferListSelector.cancel': '⟦Çàñçéł⟧',
|
|
491
491
|
'@astryx.transferListSelector.triggerLabel': '⟦{count, number} šéłéçţéð⟧',
|
|
492
|
+
'@astryx.emojiPicker.label': '⟦Éɱóĵí⟧',
|
|
493
|
+
'@astryx.emojiPicker.searchLabel': '⟦Šéàřçĥ éɱóĵí⟧',
|
|
494
|
+
'@astryx.emojiPicker.frequentlyUsed': '⟦Ƒřéɋúéñţłý úšéð⟧',
|
|
495
|
+
'@astryx.emojiPicker.searchResults': '⟦Šéàřçĥ řéšúłţš⟧',
|
|
496
|
+
'@astryx.emojiPicker.noResults': '⟦Ñó éɱóĵí ɱàţçĥ “{query}”⟧',
|
|
497
|
+
'@astryx.emojiPicker.loading': '⟦Łóàðíñĝ éɱóĵí⟧',
|
|
498
|
+
'@astryx.emojiPicker.loadFailed': "⟦Ṁóřé éɱóĵí çóúłðñ'ţ ƀé łóàðéð.⟧",
|
|
499
|
+
'@astryx.emojiPicker.groupSmileysEmotion': '⟦Šɱíłéýš & éɱóţíóñ⟧',
|
|
500
|
+
'@astryx.emojiPicker.groupPeopleBody': '⟦Þéóþłé & ƀóðý⟧',
|
|
501
|
+
'@astryx.emojiPicker.groupAnimalsNature': '⟦Àñíɱàłš & ñàţúřé⟧',
|
|
502
|
+
'@astryx.emojiPicker.groupFoodDrink': '⟦Ƒóóð & ðříñķ⟧',
|
|
503
|
+
'@astryx.emojiPicker.groupTravelPlaces': '⟦Ţřàṽéł & þłàçéš⟧',
|
|
504
|
+
'@astryx.emojiPicker.groupActivities': '⟦Àçţíṽíţíéš⟧',
|
|
505
|
+
'@astryx.emojiPicker.groupObjects': '⟦Óƀĵéçţš⟧',
|
|
506
|
+
'@astryx.emojiPicker.groupSymbols': '⟦Šýɱƀółš⟧',
|
|
507
|
+
'@astryx.emojiPicker.groupFlags': '⟦Ƒłàĝš⟧',
|
|
492
508
|
};
|
|
493
509
|
|
|
494
510
|
export default runtimeCatalog;
|