@lokascript/hyperscript-adapter 2.7.2 → 2.8.0
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/hyperscript-i18n-ar.global.js +5 -5
- package/dist/hyperscript-i18n-bn.global.js +5 -5
- package/dist/hyperscript-i18n-de.global.js +5 -5
- package/dist/hyperscript-i18n-east-asian.global.js +5 -5
- package/dist/hyperscript-i18n-en.global.js +7 -7
- package/dist/hyperscript-i18n-es.global.js +5 -5
- package/dist/hyperscript-i18n-fr.global.js +5 -5
- package/dist/hyperscript-i18n-he.global.js +5 -5
- package/dist/hyperscript-i18n-hi.global.js +5 -5
- package/dist/hyperscript-i18n-id.global.js +5 -5
- package/dist/hyperscript-i18n-it.global.js +5 -5
- package/dist/hyperscript-i18n-ja.global.js +5 -5
- package/dist/hyperscript-i18n-ko.global.js +5 -5
- package/dist/hyperscript-i18n-ms.global.js +5 -5
- package/dist/hyperscript-i18n-pl.global.js +5 -5
- package/dist/hyperscript-i18n-pt.global.js +5 -5
- package/dist/hyperscript-i18n-qu.global.js +5 -5
- package/dist/hyperscript-i18n-ru.global.js +5 -5
- package/dist/hyperscript-i18n-slavic.global.js +5 -5
- package/dist/hyperscript-i18n-south-asian.global.js +5 -5
- package/dist/hyperscript-i18n-southeast-asian.global.js +5 -5
- package/dist/hyperscript-i18n-sw.global.js +5 -5
- package/dist/hyperscript-i18n-th.global.js +5 -5
- package/dist/hyperscript-i18n-tl.global.js +5 -5
- package/dist/hyperscript-i18n-tr.global.js +5 -5
- package/dist/hyperscript-i18n-uk.global.js +5 -5
- package/dist/hyperscript-i18n-vi.global.js +5 -5
- package/dist/hyperscript-i18n-western.global.js +5 -5
- package/dist/hyperscript-i18n-zh.global.js +5 -5
- package/dist/hyperscript-i18n.global.js +28 -27
- package/dist/hyperscript-i18n.global.js.map +1 -1
- package/package.json +2 -2
- package/src/generated/syntax-table.ts +1 -1
- package/src/hyperscript-renderer.ts +10 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lokascript/hyperscript-adapter",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"description": "Multilingual adapter plugin for original _hyperscript — write hyperscript in 24 languages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
},
|
|
143
143
|
"homepage": "https://github.com/codetalcott/hyperfixi/tree/main/packages/hyperscript-adapter#readme",
|
|
144
144
|
"dependencies": {
|
|
145
|
-
"@lokascript/semantic": "^2.
|
|
145
|
+
"@lokascript/semantic": "^2.8.0"
|
|
146
146
|
},
|
|
147
147
|
"optionalDependencies": {
|
|
148
148
|
"@lokascript/i18n": "*"
|
|
@@ -26,7 +26,7 @@ export const SYNTAX: Record<string, readonly [string, string][]> = {
|
|
|
26
26
|
empty: [['patient', '']],
|
|
27
27
|
eventsource: [],
|
|
28
28
|
exit: [],
|
|
29
|
-
fetch: [['source', ''], ['responseType', 'as'], ['method', 'via'], ['destination', 'on']],
|
|
29
|
+
fetch: [['source', ''], ['style', 'with'], ['responseType', 'as'], ['method', 'via'], ['destination', 'on']],
|
|
30
30
|
focus: [['patient', '']],
|
|
31
31
|
for: [['patient', ''], ['source', 'in']],
|
|
32
32
|
get: [['source', ''], ['destination', 'on']],
|
|
@@ -88,8 +88,16 @@ function renderCommand(node: SemanticNode): string {
|
|
|
88
88
|
for (const [role, prep] of syntax) {
|
|
89
89
|
const value = node.roles.get(role as SemanticRole);
|
|
90
90
|
if (!value) continue;
|
|
91
|
-
// Skip implicit "me" destination (default in _hyperscript)
|
|
92
|
-
|
|
91
|
+
// Skip an implicit "me" destination/source (the default in _hyperscript) —
|
|
92
|
+
// `add .active` not `add .active to me`; `remove .hidden` not `remove .hidden
|
|
93
|
+
// from me`. Mirrors the semantic renderer's implicit-me suppression so the
|
|
94
|
+
// full and slim (custom-renderer) paths agree.
|
|
95
|
+
if (
|
|
96
|
+
(role === 'destination' || role === 'source') &&
|
|
97
|
+
value.type === 'reference' &&
|
|
98
|
+
value.value === 'me'
|
|
99
|
+
)
|
|
100
|
+
continue;
|
|
93
101
|
if (prep) parts.push(prep);
|
|
94
102
|
parts.push(renderValue(value));
|
|
95
103
|
}
|