@almadar/core 10.129.0 → 11.0.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/behavior-package.d.ts +49 -11
- package/dist/behavior-package.js +1 -1
- package/dist/{orbital-CkFdDS9f.d.ts → builders-BhnofAik.d.ts} +5966 -7116
- package/dist/builders.d.ts +6 -6
- package/dist/builders.js +7 -6
- package/dist/{bus-CcbB__oo.d.ts → bus-BrRFWDQK.d.ts} +270 -354
- package/dist/chunk-347APWFM.js +286 -0
- package/dist/chunk-347APWFM.js.map +1 -0
- package/dist/chunk-3URQAGD7.js +98 -0
- package/dist/chunk-3URQAGD7.js.map +1 -0
- package/dist/chunk-7GHJU5WI.js +39 -0
- package/dist/chunk-7GHJU5WI.js.map +1 -0
- package/dist/chunk-B4MNHGBP.js +8 -0
- package/dist/chunk-B4MNHGBP.js.map +1 -0
- package/dist/{chunk-KDMV222Q.js → chunk-F6KHUW7T.js} +304 -373
- package/dist/chunk-F6KHUW7T.js.map +1 -0
- package/dist/chunk-FGT5OS2Y.js +918 -0
- package/dist/chunk-FGT5OS2Y.js.map +1 -0
- package/dist/chunk-FQLEAMAB.js +24 -0
- package/dist/chunk-FQLEAMAB.js.map +1 -0
- package/dist/chunk-HEXOGHQ4.js +3264 -0
- package/dist/chunk-HEXOGHQ4.js.map +1 -0
- package/dist/chunk-JCD6GLBX.js +412 -0
- package/dist/chunk-JCD6GLBX.js.map +1 -0
- package/dist/{chunk-QUOTJULD.js → chunk-MGLG2XLD.js} +20 -219
- package/dist/chunk-MGLG2XLD.js.map +1 -0
- package/dist/chunk-MTBEBSNO.js +1293 -0
- package/dist/chunk-MTBEBSNO.js.map +1 -0
- package/dist/{chunk-X4SC7FGF.js → chunk-RGACZEYC.js} +99 -96
- package/dist/chunk-RGACZEYC.js.map +1 -0
- package/dist/{chunk-RYPVOI6H.js → chunk-UZPYYI37.js} +524 -26
- package/dist/{chunk-RYPVOI6H.js.map → chunk-UZPYYI37.js.map} +1 -1
- package/dist/chunk-VG7BRFUD.js +152 -0
- package/dist/chunk-VG7BRFUD.js.map +1 -0
- package/dist/chunk-Y2DYZPP5.js +2329 -0
- package/dist/chunk-Y2DYZPP5.js.map +1 -0
- package/dist/chunk-ZEI7C32D.js +1566 -0
- package/dist/chunk-ZEI7C32D.js.map +1 -0
- package/dist/{domain-Dz3jP-UM.d.ts → domain-CfKPpXCP.d.ts} +51 -51
- package/dist/{effect-result-Bebwu9yT.d.ts → effect-result-DPERsn_v.d.ts} +641 -851
- package/dist/{effect-CiEVLsZz.d.ts → effect-wP-IdRt2.d.ts} +236 -443
- package/dist/{expression-D0Fs0riG.d.ts → expression-DirYKz-f.d.ts} +5 -13
- package/dist/factory/index.d.ts +7 -144
- package/dist/factory/index.js +8 -8
- package/dist/factory-runtime/index.d.ts +7 -6
- package/dist/factory-runtime/index.js +527 -8
- package/dist/factory-runtime/index.js.map +1 -1
- package/dist/fixtures.d.ts +9 -11
- package/dist/fixtures.js +12 -8
- package/dist/fixtures.js.map +1 -1
- package/dist/i18n/index.d.ts +15 -19
- package/dist/i18n/index.js +2 -1
- package/dist/{index-BC-Jycqj.d.ts → index-DomgmRBG.d.ts} +29 -729
- package/dist/index.d.ts +69 -247
- package/dist/index.js +322 -986
- package/dist/index.js.map +1 -1
- package/dist/kernel-wire.d.ts +3 -3
- package/dist/kernel-wire.js +3 -79
- package/dist/kernel-wire.js.map +1 -1
- package/dist/language/constructs.json +22 -2
- package/dist/language/program-types.json +203 -22
- package/dist/language/protocols.json +46 -0
- package/dist/language/ui-vocabulary.json +1697 -0
- package/dist/language/validation-codes.json +1205 -1215
- package/dist/language/vocabulary.json +44 -8
- package/dist/language-data.d.ts +7 -4
- package/dist/language-data.js +20 -14
- package/dist/language-data.js.map +1 -1
- package/dist/patterns/component-mapping.json +11 -1
- package/dist/patterns/definitions.d.ts +2 -2
- package/dist/patterns/definitions.js +1 -1
- package/dist/patterns/event-contracts.json +1 -15
- package/dist/patterns/index.d.ts +24 -120
- package/dist/patterns/index.js +3 -3
- package/dist/patterns/patterns-registry.json +522 -24
- package/dist/patterns/registry.json +522 -24
- package/dist/trait-CzG9M89M.d.ts +3519 -0
- package/dist/types/index.d.ts +9 -10
- package/dist/types/index.js +11 -5
- package/dist/{types-DGwrltUF.d.ts → types-BHlTjwWd.d.ts} +3 -3
- package/fixtures/events-wire/client-effects-by-trait/response.json +0 -18
- package/fixtures/events-wire/client-effects-provenance/response.json +0 -18
- package/fixtures/events-wire/effect-results-every-kind/response.json +2 -27
- package/fixtures/events-wire/navigate-1/response.json +8 -5
- package/fixtures/events-wire/navigate-2/response.json +11 -8
- package/fixtures/events-wire/navigate-3/response.json +14 -11
- package/fixtures/events-wire/navigate-back/response.json +7 -4
- package/fixtures/events-wire/render-ui-3/response.json +12 -9
- package/fixtures/events-wire/render-ui-clear/response.json +0 -7
- package/fixtures/events-wire/sse-stream/response.json +0 -20
- package/fixtures/events-wire/sse-stream/stream.json +0 -20
- package/fixtures/events-wire/stateless-traits/response.json +14 -5
- package/fixtures/kernel-wire/golden/basic-entity.json +1687 -0
- package/fixtures/kernel-wire/golden/entity-rerender.json +743 -0
- package/fixtures/kernel-wire/golden/rollback.json +793 -0
- package/fixtures/kernel-wire/golden/tick-counter.json +1538 -0
- package/fixtures/kernel-wire/golden/two-orbital-chore.json +847 -0
- package/fixtures/kernel-wire/golden/two-orbital-task.json +457 -0
- package/fixtures/kernel-wire/played-step.json +136 -0
- package/fixtures/kernel-wire/scripts/basic-entity.json +28 -0
- package/fixtures/kernel-wire/scripts/entity-rerender.json +13 -0
- package/fixtures/kernel-wire/scripts/rollback.json +53 -0
- package/fixtures/kernel-wire/scripts/tick-counter.json +26 -0
- package/fixtures/kernel-wire/scripts/two-orbital-chore.json +9 -0
- package/fixtures/kernel-wire/scripts/two-orbital-task.json +9 -0
- package/package.json +28 -19
- package/dist/builders-DmZE5By0.d.ts +0 -2663
- package/dist/chunk-45I2O4SJ.js +0 -4646
- package/dist/chunk-45I2O4SJ.js.map +0 -1
- package/dist/chunk-6LR43Z5E.js +0 -3061
- package/dist/chunk-6LR43Z5E.js.map +0 -1
- package/dist/chunk-GIUA3NUJ.js +0 -809
- package/dist/chunk-GIUA3NUJ.js.map +0 -1
- package/dist/chunk-GTY53NS5.js +0 -1908
- package/dist/chunk-GTY53NS5.js.map +0 -1
- package/dist/chunk-JOHDVS6J.js +0 -1614
- package/dist/chunk-JOHDVS6J.js.map +0 -1
- package/dist/chunk-KDMV222Q.js.map +0 -1
- package/dist/chunk-QRHJUS3D.js +0 -23
- package/dist/chunk-QRHJUS3D.js.map +0 -1
- package/dist/chunk-QUOTJULD.js.map +0 -1
- package/dist/chunk-V5VNGRVU.js +0 -66
- package/dist/chunk-V5VNGRVU.js.map +0 -1
- package/dist/chunk-X4SC7FGF.js.map +0 -1
- package/dist/entityAccess-BPSz1i2n.d.ts +0 -80
- package/dist/mock/index.d.ts +0 -153
- package/dist/mock/index.js +0 -190
- package/dist/mock/index.js.map +0 -1
- package/dist/schema-T5RT5s6H.d.ts +0 -282
- package/dist/state-machine/index.d.ts +0 -359
- package/dist/state-machine/index.js +0 -3
- package/dist/state-machine/index.js.map +0 -1
package/dist/chunk-JOHDVS6J.js
DELETED
|
@@ -1,1614 +0,0 @@
|
|
|
1
|
-
// src/i18n/orb-notation.json
|
|
2
|
-
var orb_notation_default = {
|
|
3
|
-
reason: "Design-system token NAMES reachable only under a theme `tokens` node. They are keys of the .orb schema but notation, not language vocabulary, so they are excluded from the `orb` i18n section (owner ruling 2026-09-07). Regenerate with: pnpm --filter @almadar/core run gen:orb-notation",
|
|
4
|
-
keys: [
|
|
5
|
-
"2xl",
|
|
6
|
-
"3xl",
|
|
7
|
-
"4xl",
|
|
8
|
-
"accent",
|
|
9
|
-
"accentForeground",
|
|
10
|
-
"accentImage",
|
|
11
|
-
"awaitingSkeleton",
|
|
12
|
-
"backdrop",
|
|
13
|
-
"background",
|
|
14
|
-
"base",
|
|
15
|
-
"bodyDefault",
|
|
16
|
-
"bodyEmphasis",
|
|
17
|
-
"bodyFamily",
|
|
18
|
-
"bodyQuiet",
|
|
19
|
-
"border",
|
|
20
|
-
"borderHairline",
|
|
21
|
-
"borderHeavy",
|
|
22
|
-
"borderHover",
|
|
23
|
-
"borderStandard",
|
|
24
|
-
"borderStyle",
|
|
25
|
-
"borderStyleInteractive",
|
|
26
|
-
"busyDelay",
|
|
27
|
-
"buttonHeightLg",
|
|
28
|
-
"buttonHeightMd",
|
|
29
|
-
"buttonHeightSm",
|
|
30
|
-
"caption",
|
|
31
|
-
"card",
|
|
32
|
-
"cardElevation",
|
|
33
|
-
"cardForeground",
|
|
34
|
-
"cardImage",
|
|
35
|
-
"cardPaddingLg",
|
|
36
|
-
"cardPaddingMd",
|
|
37
|
-
"cardPaddingSm",
|
|
38
|
-
"corner",
|
|
39
|
-
"cornerShape",
|
|
40
|
-
"cornerShapeInteractive",
|
|
41
|
-
"cornerShapePill",
|
|
42
|
-
"dash",
|
|
43
|
-
"defaultSize",
|
|
44
|
-
"dialogElevation",
|
|
45
|
-
"dialogPadding",
|
|
46
|
-
"display-1",
|
|
47
|
-
"display-2",
|
|
48
|
-
"displayFamily",
|
|
49
|
-
"dot",
|
|
50
|
-
"dramatic",
|
|
51
|
-
"duration",
|
|
52
|
-
"durations",
|
|
53
|
-
"easing",
|
|
54
|
-
"easings",
|
|
55
|
-
"edgeHeight",
|
|
56
|
-
"edgeMask",
|
|
57
|
-
"emphasized",
|
|
58
|
-
"emptyAsset",
|
|
59
|
-
"enter",
|
|
60
|
-
"enterRise",
|
|
61
|
-
"enterScale",
|
|
62
|
-
"enterSlide",
|
|
63
|
-
"entry",
|
|
64
|
-
"error",
|
|
65
|
-
"errorAsset",
|
|
66
|
-
"errorForeground",
|
|
67
|
-
"exit",
|
|
68
|
-
"expand",
|
|
69
|
-
"family",
|
|
70
|
-
"fast",
|
|
71
|
-
"fillOpacity",
|
|
72
|
-
"fillStyle",
|
|
73
|
-
"fog",
|
|
74
|
-
"fontImport",
|
|
75
|
-
"foreground",
|
|
76
|
-
"glow",
|
|
77
|
-
"headingMajor",
|
|
78
|
-
"headingMinor",
|
|
79
|
-
"headingShadow",
|
|
80
|
-
"headingStyle",
|
|
81
|
-
"headingTracking",
|
|
82
|
-
"headingTransform",
|
|
83
|
-
"headingWeight",
|
|
84
|
-
"hover",
|
|
85
|
-
"info",
|
|
86
|
-
"infoForeground",
|
|
87
|
-
"inputHeightLg",
|
|
88
|
-
"inputHeightMd",
|
|
89
|
-
"inputHeightSm",
|
|
90
|
-
"instant",
|
|
91
|
-
"intents",
|
|
92
|
-
"interactiveElevation",
|
|
93
|
-
"labelCase",
|
|
94
|
-
"labelFont",
|
|
95
|
-
"labelSize",
|
|
96
|
-
"labelWeight",
|
|
97
|
-
"lg",
|
|
98
|
-
"lightAmbient",
|
|
99
|
-
"lightKey",
|
|
100
|
-
"lightKeyColor",
|
|
101
|
-
"lineCap",
|
|
102
|
-
"lineHeight",
|
|
103
|
-
"lineJoin",
|
|
104
|
-
"linear",
|
|
105
|
-
"loadingAsset",
|
|
106
|
-
"marker",
|
|
107
|
-
"materialFlat",
|
|
108
|
-
"materialMetalness",
|
|
109
|
-
"materialOutline",
|
|
110
|
-
"materialRoughness",
|
|
111
|
-
"modalEnter",
|
|
112
|
-
"modalExit",
|
|
113
|
-
"monoFamily",
|
|
114
|
-
"muted",
|
|
115
|
-
"mutedForeground",
|
|
116
|
-
"normal",
|
|
117
|
-
"numeric",
|
|
118
|
-
"onboardingAsset",
|
|
119
|
-
"pageEnter",
|
|
120
|
-
"pageImage",
|
|
121
|
-
"pageImageSize",
|
|
122
|
-
"placeholder",
|
|
123
|
-
"popoverElevation",
|
|
124
|
-
"popoverEnter",
|
|
125
|
-
"popoverExit",
|
|
126
|
-
"press",
|
|
127
|
-
"pressedElevation",
|
|
128
|
-
"primary",
|
|
129
|
-
"primaryForeground",
|
|
130
|
-
"primaryHover",
|
|
131
|
-
"radiusContainer",
|
|
132
|
-
"radiusInteractive",
|
|
133
|
-
"radiusPill",
|
|
134
|
-
"ring",
|
|
135
|
-
"roughness",
|
|
136
|
-
"rowHeightCompact",
|
|
137
|
-
"rowHeightNormal",
|
|
138
|
-
"rowHeightSpacious",
|
|
139
|
-
"scale",
|
|
140
|
-
"scrim",
|
|
141
|
-
"secondary",
|
|
142
|
-
"secondaryForeground",
|
|
143
|
-
"secondaryHover",
|
|
144
|
-
"sectionGap",
|
|
145
|
-
"shadow",
|
|
146
|
-
"shapes",
|
|
147
|
-
"size",
|
|
148
|
-
"slow",
|
|
149
|
-
"sm",
|
|
150
|
-
"space0",
|
|
151
|
-
"space1",
|
|
152
|
-
"space10",
|
|
153
|
-
"space11",
|
|
154
|
-
"space12",
|
|
155
|
-
"space2",
|
|
156
|
-
"space3",
|
|
157
|
-
"space4",
|
|
158
|
-
"space5",
|
|
159
|
-
"space6",
|
|
160
|
-
"space7",
|
|
161
|
-
"space8",
|
|
162
|
-
"space9",
|
|
163
|
-
"spring",
|
|
164
|
-
"stagger",
|
|
165
|
-
"standard",
|
|
166
|
-
"strokeBold",
|
|
167
|
-
"strokeNormal",
|
|
168
|
-
"strokeThin",
|
|
169
|
-
"strokeWidth",
|
|
170
|
-
"success",
|
|
171
|
-
"successForeground",
|
|
172
|
-
"surfaceHover",
|
|
173
|
-
"tableBorder",
|
|
174
|
-
"tableHeader",
|
|
175
|
-
"tableRowHover",
|
|
176
|
-
"textureMask",
|
|
177
|
-
"textureSize",
|
|
178
|
-
"toastElevation",
|
|
179
|
-
"toastEnter",
|
|
180
|
-
"toastExit",
|
|
181
|
-
"warning",
|
|
182
|
-
"warningForeground",
|
|
183
|
-
"weight",
|
|
184
|
-
"xl",
|
|
185
|
-
"xs"
|
|
186
|
-
]
|
|
187
|
-
};
|
|
188
|
-
|
|
189
|
-
// src/i18n/en.json
|
|
190
|
-
var en_default = {
|
|
191
|
-
meta: {
|
|
192
|
-
code: "en",
|
|
193
|
-
name: "English",
|
|
194
|
-
rtl: false
|
|
195
|
-
},
|
|
196
|
-
keywords: {
|
|
197
|
-
app: "app",
|
|
198
|
-
orbital: "orbital",
|
|
199
|
-
uses: "uses",
|
|
200
|
-
expects: "expects",
|
|
201
|
-
entity: "entity",
|
|
202
|
-
type: "type",
|
|
203
|
-
derived: "derived",
|
|
204
|
-
trait: "trait",
|
|
205
|
-
initial: "initial",
|
|
206
|
-
state: "state",
|
|
207
|
-
for: "for",
|
|
208
|
-
page: "page",
|
|
209
|
-
as: "as",
|
|
210
|
-
theme: "theme",
|
|
211
|
-
emits: "emits",
|
|
212
|
-
listens: "listens",
|
|
213
|
-
ticks: "ticks",
|
|
214
|
-
config: "config",
|
|
215
|
-
when: "when",
|
|
216
|
-
with: "with",
|
|
217
|
-
from: "from",
|
|
218
|
-
to: "to",
|
|
219
|
-
every: "every",
|
|
220
|
-
capabilities: "capabilities",
|
|
221
|
-
match: "match",
|
|
222
|
-
external: "external",
|
|
223
|
-
internal: "internal",
|
|
224
|
-
on: "on",
|
|
225
|
-
name: "name",
|
|
226
|
-
fields: "fields",
|
|
227
|
-
events: "events",
|
|
228
|
-
event: "event",
|
|
229
|
-
emitsScope: "emitsScope",
|
|
230
|
-
identity: "identity",
|
|
231
|
-
pages: "pages",
|
|
232
|
-
omit: "omit",
|
|
233
|
-
only: "only",
|
|
234
|
-
roles: "roles",
|
|
235
|
-
entities: "entities",
|
|
236
|
-
extend: "extend",
|
|
237
|
-
retype: "retype",
|
|
238
|
-
traits: "traits",
|
|
239
|
-
mock: "mock",
|
|
240
|
-
lazy: "lazy",
|
|
241
|
-
locales: "locales",
|
|
242
|
-
egress: "egress",
|
|
243
|
-
store: "store",
|
|
244
|
-
themes: "themes",
|
|
245
|
-
public: "public",
|
|
246
|
-
instances: "instances",
|
|
247
|
-
access: "access",
|
|
248
|
-
indexing: "indexing",
|
|
249
|
-
title: "title",
|
|
250
|
-
description: "description",
|
|
251
|
-
origin: "origin",
|
|
252
|
-
icon: "icon",
|
|
253
|
-
siteName: "siteName",
|
|
254
|
-
signIn: "signIn",
|
|
255
|
-
authenticated: "authenticated",
|
|
256
|
-
index: "index",
|
|
257
|
-
noindex: "noindex",
|
|
258
|
-
version: "version",
|
|
259
|
-
translationOf: "translationOf",
|
|
260
|
-
label: "label",
|
|
261
|
-
inbound: "inbound",
|
|
262
|
-
answers: "answers",
|
|
263
|
-
verifies: "verifies",
|
|
264
|
-
fs: "fs",
|
|
265
|
-
exec: "exec",
|
|
266
|
-
net: "net",
|
|
267
|
-
env: "env",
|
|
268
|
-
stdio: "stdio",
|
|
269
|
-
sys: "sys",
|
|
270
|
-
desktop: "desktop",
|
|
271
|
-
kv: "kv",
|
|
272
|
-
deployment: "deployment",
|
|
273
|
-
input: "input",
|
|
274
|
-
http: "http",
|
|
275
|
-
boot: "boot"
|
|
276
|
-
},
|
|
277
|
-
shapes: {
|
|
278
|
-
Entity: "Entity",
|
|
279
|
-
Trait: "Trait",
|
|
280
|
-
Page: "Page",
|
|
281
|
-
Orbital: "Orbital",
|
|
282
|
-
Event: "Event"
|
|
283
|
-
},
|
|
284
|
-
tags: {
|
|
285
|
-
persistent: "persistent",
|
|
286
|
-
runtime: "runtime",
|
|
287
|
-
shared: "shared",
|
|
288
|
-
client: "client",
|
|
289
|
-
optimistic: "optimistic",
|
|
290
|
-
server: "server",
|
|
291
|
-
browser: "browser",
|
|
292
|
-
identity: "identity",
|
|
293
|
-
background: "background",
|
|
294
|
-
visible: "visible",
|
|
295
|
-
store: "store"
|
|
296
|
-
},
|
|
297
|
-
categories: {},
|
|
298
|
-
capabilities: {
|
|
299
|
-
read: "read",
|
|
300
|
-
write: "write",
|
|
301
|
-
browse: "browse",
|
|
302
|
-
create: "create",
|
|
303
|
-
upsert: "upsert",
|
|
304
|
-
update: "update",
|
|
305
|
-
delete: "delete",
|
|
306
|
-
notify: "notify",
|
|
307
|
-
schedule: "schedule",
|
|
308
|
-
invoke: "invoke",
|
|
309
|
-
batch: "batch"
|
|
310
|
-
},
|
|
311
|
-
annotations: {
|
|
312
|
-
key: "key",
|
|
313
|
-
unique: "unique",
|
|
314
|
-
intrinsic: "intrinsic",
|
|
315
|
-
label: "label",
|
|
316
|
-
description: "description",
|
|
317
|
-
synonyms: "synonyms",
|
|
318
|
-
mock: "mock",
|
|
319
|
-
tier: "tier",
|
|
320
|
-
rebindable: "rebindable",
|
|
321
|
-
read: "read",
|
|
322
|
-
create: "create",
|
|
323
|
-
update: "update",
|
|
324
|
-
delete: "delete",
|
|
325
|
-
icon: "icon",
|
|
326
|
-
roles: "roles",
|
|
327
|
-
invariant: "invariant",
|
|
328
|
-
holds: "holds",
|
|
329
|
-
ensures: "ensures"
|
|
330
|
-
},
|
|
331
|
-
sigils: {
|
|
332
|
-
entity: "entity",
|
|
333
|
-
payload: "payload",
|
|
334
|
-
state: "state",
|
|
335
|
-
now: "now",
|
|
336
|
-
config: "config",
|
|
337
|
-
user: "user",
|
|
338
|
-
trait: "trait",
|
|
339
|
-
event: "event",
|
|
340
|
-
prevEvents: "prevEvents",
|
|
341
|
-
prevStates: "prevStates",
|
|
342
|
-
fromState: "fromState",
|
|
343
|
-
toState: "toState",
|
|
344
|
-
fromEntity: "fromEntity",
|
|
345
|
-
locale: "locale"
|
|
346
|
-
},
|
|
347
|
-
effects: {
|
|
348
|
-
set: "set",
|
|
349
|
-
fetch: "fetch",
|
|
350
|
-
persist: "persist",
|
|
351
|
-
emit: "emit",
|
|
352
|
-
navigate: "navigate",
|
|
353
|
-
"navigate-back": "navigate-back",
|
|
354
|
-
"render-ui": "render-ui",
|
|
355
|
-
notify: "notify",
|
|
356
|
-
ref: "ref",
|
|
357
|
-
"call-service": "call-service",
|
|
358
|
-
http: "http",
|
|
359
|
-
redis: "redis",
|
|
360
|
-
postgres: "postgres",
|
|
361
|
-
"cancel-call": "cancel-call",
|
|
362
|
-
invoke: "invoke",
|
|
363
|
-
do: "do",
|
|
364
|
-
if: "if",
|
|
365
|
-
let: "let",
|
|
366
|
-
fn: "fn",
|
|
367
|
-
lambda: "lambda",
|
|
368
|
-
quote: "quote",
|
|
369
|
-
quasiquote: "quasiquote",
|
|
370
|
-
unquote: "unquote",
|
|
371
|
-
match: "match",
|
|
372
|
-
when: "when",
|
|
373
|
-
"random-bytes": "random-bytes",
|
|
374
|
-
"credential-status": "credential-status",
|
|
375
|
-
"credential-forget": "credential-forget",
|
|
376
|
-
"credential-list": "credential-list",
|
|
377
|
-
"credential-set": "credential-set",
|
|
378
|
-
"credential-remove": "credential-remove",
|
|
379
|
-
"credential-test": "credential-test",
|
|
380
|
-
"credential-mode": "credential-mode",
|
|
381
|
-
"credential-rotate": "credential-rotate",
|
|
382
|
-
"oauth-authorize": "oauth-authorize",
|
|
383
|
-
"oauth-connection-status": "oauth-connection-status",
|
|
384
|
-
"oauth-connection-forget": "oauth-connection-forget"
|
|
385
|
-
},
|
|
386
|
-
types: {
|
|
387
|
-
string: "string",
|
|
388
|
-
number: "number",
|
|
389
|
-
int: "int",
|
|
390
|
-
float: "float",
|
|
391
|
-
bool: "bool",
|
|
392
|
-
boolean: "boolean",
|
|
393
|
-
timestamp: "timestamp",
|
|
394
|
-
date: "date",
|
|
395
|
-
datetime: "datetime",
|
|
396
|
-
duration: "duration",
|
|
397
|
-
money: "money",
|
|
398
|
-
file: "file",
|
|
399
|
-
bytes: "bytes",
|
|
400
|
-
email: "email",
|
|
401
|
-
url: "url",
|
|
402
|
-
phone: "phone",
|
|
403
|
-
uuid: "uuid",
|
|
404
|
-
image: "image",
|
|
405
|
-
icon: "icon",
|
|
406
|
-
asset: "asset",
|
|
407
|
-
component: "component",
|
|
408
|
-
object: "object",
|
|
409
|
-
array: "array",
|
|
410
|
-
enum: "enum",
|
|
411
|
-
relation: "relation",
|
|
412
|
-
node: "node",
|
|
413
|
-
union: "union",
|
|
414
|
-
tuple: "tuple",
|
|
415
|
-
void: "void",
|
|
416
|
-
null: "null",
|
|
417
|
-
any: "any",
|
|
418
|
-
trait: "trait",
|
|
419
|
-
orbital: "orbital",
|
|
420
|
-
behavior: "behavior",
|
|
421
|
-
entity: "entity",
|
|
422
|
-
event: "event",
|
|
423
|
-
EventAddress: "EventAddress",
|
|
424
|
-
CallKey: "CallKey",
|
|
425
|
-
field: "field",
|
|
426
|
-
slot: "slot",
|
|
427
|
-
pattern: "pattern",
|
|
428
|
-
Map: "Map",
|
|
429
|
-
secret: "secret",
|
|
430
|
-
SExpr: "SExpr"
|
|
431
|
-
},
|
|
432
|
-
units: {
|
|
433
|
-
ms: "ms",
|
|
434
|
-
s: "s",
|
|
435
|
-
m: "m",
|
|
436
|
-
h: "h",
|
|
437
|
-
d: "d"
|
|
438
|
-
},
|
|
439
|
-
literals: {
|
|
440
|
-
true: "true",
|
|
441
|
-
false: "false",
|
|
442
|
-
null: "null"
|
|
443
|
-
},
|
|
444
|
-
reservedEvents: {
|
|
445
|
-
INIT: "INIT"
|
|
446
|
-
},
|
|
447
|
-
orb: {
|
|
448
|
-
_metadata: "_metadata",
|
|
449
|
-
_resolved: "_resolved",
|
|
450
|
-
access_waivers: "access_waivers",
|
|
451
|
-
ensures: "ensures",
|
|
452
|
-
holds: "holds",
|
|
453
|
-
invariants: "invariants",
|
|
454
|
-
alias: "alias",
|
|
455
|
-
animations: "animations",
|
|
456
|
-
appliesTo: "appliesTo",
|
|
457
|
-
as: "as",
|
|
458
|
-
aspect: "aspect",
|
|
459
|
-
assetRef: "assetRef",
|
|
460
|
-
at: "at",
|
|
461
|
-
auth: "auth",
|
|
462
|
-
auxiliaryEntities: "auxiliaryEntities",
|
|
463
|
-
awaitRender: "awaitRender",
|
|
464
|
-
bakedName: "bakedName",
|
|
465
|
-
baseUrl: "baseUrl",
|
|
466
|
-
behavior: "behavior",
|
|
467
|
-
capabilities: "capabilities",
|
|
468
|
-
cardinality: "cardinality",
|
|
469
|
-
category: "category",
|
|
470
|
-
className: "className",
|
|
471
|
-
classification: "classification",
|
|
472
|
-
collection: "collection",
|
|
473
|
-
color: "color",
|
|
474
|
-
colors: "colors",
|
|
475
|
-
columns: "columns",
|
|
476
|
-
component: "component",
|
|
477
|
-
config: "config",
|
|
478
|
-
configProvenance: "configProvenance",
|
|
479
|
-
container: "container",
|
|
480
|
-
content: "content",
|
|
481
|
-
create: "create",
|
|
482
|
-
create_policy: "create_policy",
|
|
483
|
-
createdAt: "createdAt",
|
|
484
|
-
curName: "curName",
|
|
485
|
-
customPatterns: "customPatterns",
|
|
486
|
-
darkMode: "darkMode",
|
|
487
|
-
dataEntities: "dataEntities",
|
|
488
|
-
default: "default",
|
|
489
|
-
definerKnob: "definerKnob",
|
|
490
|
-
delayMs: "delayMs",
|
|
491
|
-
delete: "delete",
|
|
492
|
-
delete_policy: "delete_policy",
|
|
493
|
-
density: "density",
|
|
494
|
-
description: "description",
|
|
495
|
-
description_visual_prompt: "description_visual_prompt",
|
|
496
|
-
design: "design",
|
|
497
|
-
designTokens: "designTokens",
|
|
498
|
-
desktop: "desktop",
|
|
499
|
-
detailPattern: "detailPattern",
|
|
500
|
-
device: "device",
|
|
501
|
-
dimension: "dimension",
|
|
502
|
-
displayName: "displayName",
|
|
503
|
-
domainContext: "domainContext",
|
|
504
|
-
effectRow: "effectRow",
|
|
505
|
-
effects: "effects",
|
|
506
|
-
elevation: "elevation",
|
|
507
|
-
emitIds: "emitIds",
|
|
508
|
-
emits: "emits",
|
|
509
|
-
emitsScope: "emitsScope",
|
|
510
|
-
enabled: "enabled",
|
|
511
|
-
entities: "entities",
|
|
512
|
-
entity: "entity",
|
|
513
|
-
entityBindingDescription: "entityBindingDescription",
|
|
514
|
-
entityBindingSynonyms: "entityBindingSynonyms",
|
|
515
|
-
entityContract: "entityContract",
|
|
516
|
-
entityId: "entityId",
|
|
517
|
-
entityRebindable: "entityRebindable",
|
|
518
|
-
entityRefIds: "entityRefIds",
|
|
519
|
-
entries: "entries",
|
|
520
|
-
env: "env",
|
|
521
|
-
equals: "equals",
|
|
522
|
-
event: "event",
|
|
523
|
-
eventId: "eventId",
|
|
524
|
-
eventIds: "eventIds",
|
|
525
|
-
events: "events",
|
|
526
|
-
exec: "exec",
|
|
527
|
-
expects: "expects",
|
|
528
|
-
exposes: "exposes",
|
|
529
|
-
extend: "extend",
|
|
530
|
-
retype: "retype",
|
|
531
|
-
extends: "extends",
|
|
532
|
-
extendsId: "extendsId",
|
|
533
|
-
external: "external",
|
|
534
|
-
field: "field",
|
|
535
|
-
fields: "fields",
|
|
536
|
-
fingerprint: "fingerprint",
|
|
537
|
-
flowPattern: "flowPattern",
|
|
538
|
-
foreignKey: "foreignKey",
|
|
539
|
-
formPattern: "formPattern",
|
|
540
|
-
forwardedFrom: "forwardedFrom",
|
|
541
|
-
from: "from",
|
|
542
|
-
fs: "fs",
|
|
543
|
-
geometry: "geometry",
|
|
544
|
-
glob: "glob",
|
|
545
|
-
guard: "guard",
|
|
546
|
-
guards: "guards",
|
|
547
|
-
headers: "headers",
|
|
548
|
-
icon: "icon",
|
|
549
|
-
iconography: "iconography",
|
|
550
|
-
id: "id",
|
|
551
|
-
identity: "identity",
|
|
552
|
-
illustration: "illustration",
|
|
553
|
-
inbound: "inbound",
|
|
554
|
-
initialEffects: "initialEffects",
|
|
555
|
-
instances: "instances",
|
|
556
|
-
interactive: "interactive",
|
|
557
|
-
interval: "interval",
|
|
558
|
-
intrinsic: "intrinsic",
|
|
559
|
-
isFinal: "isFinal",
|
|
560
|
-
isInitial: "isInitial",
|
|
561
|
-
isTerminal: "isTerminal",
|
|
562
|
-
item: "item",
|
|
563
|
-
items: "items",
|
|
564
|
-
key: "key",
|
|
565
|
-
keyName: "keyName",
|
|
566
|
-
kind: "kind",
|
|
567
|
-
kinds: "kinds",
|
|
568
|
-
knob: "knob",
|
|
569
|
-
label: "label",
|
|
570
|
-
lazy: "lazy",
|
|
571
|
-
lazyPages: "lazyPages",
|
|
572
|
-
themeDefinitions: "themeDefinitions",
|
|
573
|
-
ledger: "ledger",
|
|
574
|
-
linkedEntity: "linkedEntity",
|
|
575
|
-
linkedEntityId: "linkedEntityId",
|
|
576
|
-
listPattern: "listPattern",
|
|
577
|
-
listened: "listened",
|
|
578
|
-
listens: "listens",
|
|
579
|
-
local: "local",
|
|
580
|
-
locales: "locales",
|
|
581
|
-
location: "location",
|
|
582
|
-
max: "max",
|
|
583
|
-
maxAttempts: "maxAttempts",
|
|
584
|
-
mergedFrom: "mergedFrom",
|
|
585
|
-
projectedFrom: "projectedFrom",
|
|
586
|
-
messageSources: "messageSources",
|
|
587
|
-
min: "min",
|
|
588
|
-
mock: "mock",
|
|
589
|
-
modes: "modes",
|
|
590
|
-
motion: "motion",
|
|
591
|
-
mounts: "mounts",
|
|
592
|
-
name: "name",
|
|
593
|
-
nestedForwardedFrom: "nestedForwardedFrom",
|
|
594
|
-
net: "net",
|
|
595
|
-
omit: "omit",
|
|
596
|
-
onDelete: "onDelete",
|
|
597
|
-
onEntry: "onEntry",
|
|
598
|
-
onExit: "onExit",
|
|
599
|
-
only: "only",
|
|
600
|
-
orbRef: "orbRef",
|
|
601
|
-
orbital: "orbital",
|
|
602
|
-
orbitalId: "orbitalId",
|
|
603
|
-
orbitals: "orbitals",
|
|
604
|
-
originalEvent: "originalEvent",
|
|
605
|
-
originalName: "originalName",
|
|
606
|
-
outbound: "outbound",
|
|
607
|
-
owner: "owner",
|
|
608
|
-
pageIds: "pageIds",
|
|
609
|
-
pages: "pages",
|
|
610
|
-
parent: "parent",
|
|
611
|
-
path: "path",
|
|
612
|
-
pattern: "pattern",
|
|
613
|
-
patternPath: "patternPath",
|
|
614
|
-
payload: "payload",
|
|
615
|
-
payloadEntity: "payloadEntity",
|
|
616
|
-
payloadFor: "payloadFor",
|
|
617
|
-
payloadMapping: "payloadMapping",
|
|
618
|
-
payloadSchema: "payloadSchema",
|
|
619
|
-
persistence: "persistence",
|
|
620
|
-
personas: "personas",
|
|
621
|
-
presentation: "presentation",
|
|
622
|
-
primaryColor: "primaryColor",
|
|
623
|
-
primaryEntity: "primaryEntity",
|
|
624
|
-
primaryKey: "primaryKey",
|
|
625
|
-
priority: "priority",
|
|
626
|
-
prop: "prop",
|
|
627
|
-
properties: "properties",
|
|
628
|
-
props: "props",
|
|
629
|
-
provides: "provides",
|
|
630
|
-
publicDir: "publicDir",
|
|
631
|
-
radii: "radii",
|
|
632
|
-
read: "read",
|
|
633
|
-
read_policy: "read_policy",
|
|
634
|
-
reconnect: "reconnect",
|
|
635
|
-
ref: "ref",
|
|
636
|
-
refId: "refId",
|
|
637
|
-
reference: "reference",
|
|
638
|
-
relatedLinks: "relatedLinks",
|
|
639
|
-
relation: "relation",
|
|
640
|
-
renames: "renames",
|
|
641
|
-
request: "request",
|
|
642
|
-
requestFragment: "requestFragment",
|
|
643
|
-
required: "required",
|
|
644
|
-
requiredFields: "requiredFields",
|
|
645
|
-
requires: "requires",
|
|
646
|
-
resolved: "resolved",
|
|
647
|
-
resource: "resource",
|
|
648
|
-
role: "role",
|
|
649
|
-
roles: "roles",
|
|
650
|
-
rows: "rows",
|
|
651
|
-
runsInBackground: "runsInBackground",
|
|
652
|
-
runtime: "runtime",
|
|
653
|
-
schemaVersion: "schemaVersion",
|
|
654
|
-
scope: "scope",
|
|
655
|
-
scopeOverridden: "scopeOverridden",
|
|
656
|
-
secretEnv: "secretEnv",
|
|
657
|
-
sections: "sections",
|
|
658
|
-
semanticRole: "semanticRole",
|
|
659
|
-
serverPath: "serverPath",
|
|
660
|
-
services: "services",
|
|
661
|
-
shadows: "shadows",
|
|
662
|
-
shape: "shape",
|
|
663
|
-
shared: "shared",
|
|
664
|
-
singleton: "singleton",
|
|
665
|
-
site: "site",
|
|
666
|
-
skeleton: "skeleton",
|
|
667
|
-
slot: "slot",
|
|
668
|
-
slots: "slots",
|
|
669
|
-
softDelete: "softDelete",
|
|
670
|
-
source: "source",
|
|
671
|
-
sourceBehavior: "sourceBehavior",
|
|
672
|
-
sourceDeclaration: "sourceDeclaration",
|
|
673
|
-
sourceEntityDefinition: "sourceEntityDefinition",
|
|
674
|
-
spacing: "spacing",
|
|
675
|
-
spec: "spec",
|
|
676
|
-
stack: "stack",
|
|
677
|
-
state: "state",
|
|
678
|
-
stateMachine: "stateMachine",
|
|
679
|
-
states: "states",
|
|
680
|
-
strict: "strict",
|
|
681
|
-
style: "style",
|
|
682
|
-
subDomain: "subDomain",
|
|
683
|
-
suggestedGuards: "suggestedGuards",
|
|
684
|
-
summary: "summary",
|
|
685
|
-
surface: "surface",
|
|
686
|
-
surfaces: "surfaces",
|
|
687
|
-
synonyms: "synonyms",
|
|
688
|
-
sys: "sys",
|
|
689
|
-
target: "target",
|
|
690
|
-
targetView: "targetView",
|
|
691
|
-
text: "text",
|
|
692
|
-
theme: "theme",
|
|
693
|
-
tick: "tick",
|
|
694
|
-
ticks: "ticks",
|
|
695
|
-
tier: "tier",
|
|
696
|
-
timeBoundMs: "timeBoundMs",
|
|
697
|
-
timeout: "timeout",
|
|
698
|
-
timestamps: "timestamps",
|
|
699
|
-
title: "title",
|
|
700
|
-
to: "to",
|
|
701
|
-
tokens: "tokens",
|
|
702
|
-
trait: "trait",
|
|
703
|
-
traitEmbedIds: "traitEmbedIds",
|
|
704
|
-
traitId: "traitId",
|
|
705
|
-
traitName: "traitName",
|
|
706
|
-
traitRefIds: "traitRefIds",
|
|
707
|
-
traits: "traits",
|
|
708
|
-
transition: "transition",
|
|
709
|
-
transitions: "transitions",
|
|
710
|
-
triggers: "triggers",
|
|
711
|
-
triggersId: "triggersId",
|
|
712
|
-
type: "type",
|
|
713
|
-
typeArgs: "typeArgs",
|
|
714
|
-
typeParams: "typeParams",
|
|
715
|
-
typeScale: "typeScale",
|
|
716
|
-
typeWhen: "typeWhen",
|
|
717
|
-
types: "types",
|
|
718
|
-
typography: "typography",
|
|
719
|
-
ui: "ui",
|
|
720
|
-
unique: "unique",
|
|
721
|
-
update: "update",
|
|
722
|
-
update_policy: "update_policy",
|
|
723
|
-
updatedAt: "updatedAt",
|
|
724
|
-
url: "url",
|
|
725
|
-
uses: "uses",
|
|
726
|
-
uxHints: "uxHints",
|
|
727
|
-
values: "values",
|
|
728
|
-
variant: "variant",
|
|
729
|
-
variants: "variants",
|
|
730
|
-
version: "version",
|
|
731
|
-
viewType: "viewType",
|
|
732
|
-
visual_prompt: "visual_prompt",
|
|
733
|
-
vocabulary: "vocabulary",
|
|
734
|
-
whileVisible: "whileVisible",
|
|
735
|
-
seedMock: "seedMock",
|
|
736
|
-
localeInstances: "localeInstances",
|
|
737
|
-
diagram: "diagram",
|
|
738
|
-
scene: "scene",
|
|
739
|
-
access: "access",
|
|
740
|
-
indexing: "indexing",
|
|
741
|
-
origin: "origin",
|
|
742
|
-
signIn: "signIn",
|
|
743
|
-
sourcePage: "sourcePage",
|
|
744
|
-
translationOf: "translationOf",
|
|
745
|
-
pageModifiers: "pageModifiers",
|
|
746
|
-
answers: "answers",
|
|
747
|
-
verifies: "verifies",
|
|
748
|
-
header: "header",
|
|
749
|
-
credential: "credential",
|
|
750
|
-
egress: "egress",
|
|
751
|
-
stdio: "stdio",
|
|
752
|
-
store: "store",
|
|
753
|
-
themes: "themes",
|
|
754
|
-
osGrants: "osGrants",
|
|
755
|
-
deployment: "deployment",
|
|
756
|
-
address: "address",
|
|
757
|
-
browser: "browser",
|
|
758
|
-
dispatch: "dispatch",
|
|
759
|
-
protocol: "protocol",
|
|
760
|
-
input: "input"
|
|
761
|
-
}
|
|
762
|
-
};
|
|
763
|
-
|
|
764
|
-
// src/i18n/lolo-lexer.ts
|
|
765
|
-
var IDENT_START = /[\p{L}_]/u;
|
|
766
|
-
var IDENT_CONTINUE = /[\p{L}\p{N}_/-]/u;
|
|
767
|
-
var SIGIL_CONTINUE = /[\p{L}\p{N}_.]/u;
|
|
768
|
-
var DIGIT = /[0-9]/;
|
|
769
|
-
function lexLolo(source) {
|
|
770
|
-
const tokens = [];
|
|
771
|
-
let i = 0;
|
|
772
|
-
const n = source.length;
|
|
773
|
-
const push = (kind, start, end, text, textStart) => {
|
|
774
|
-
tokens.push({
|
|
775
|
-
kind,
|
|
776
|
-
start,
|
|
777
|
-
end,
|
|
778
|
-
text: text ?? source.slice(start, end),
|
|
779
|
-
textStart: textStart ?? start
|
|
780
|
-
});
|
|
781
|
-
};
|
|
782
|
-
while (i < n) {
|
|
783
|
-
const c = source[i];
|
|
784
|
-
if (c === " " || c === " " || c === "\r" || c === "\n") {
|
|
785
|
-
i++;
|
|
786
|
-
continue;
|
|
787
|
-
}
|
|
788
|
-
if (c === "#") {
|
|
789
|
-
const start2 = i;
|
|
790
|
-
if (source[i + 1] === "=") {
|
|
791
|
-
const close = source.indexOf("=#", i + 2);
|
|
792
|
-
i = close === -1 ? n : close + 2;
|
|
793
|
-
} else {
|
|
794
|
-
const nl = source.indexOf("\n", i);
|
|
795
|
-
i = nl === -1 ? n : nl;
|
|
796
|
-
}
|
|
797
|
-
push("comment", start2, i);
|
|
798
|
-
continue;
|
|
799
|
-
}
|
|
800
|
-
if (c === ";" && source[i + 1] === ";") {
|
|
801
|
-
const start2 = i;
|
|
802
|
-
const nl = source.indexOf("\n", i);
|
|
803
|
-
i = nl === -1 ? n : nl;
|
|
804
|
-
push("comment", start2, i);
|
|
805
|
-
continue;
|
|
806
|
-
}
|
|
807
|
-
if (c === '"') {
|
|
808
|
-
const start2 = i;
|
|
809
|
-
i++;
|
|
810
|
-
while (i < n) {
|
|
811
|
-
if (source[i] === "\\") {
|
|
812
|
-
i += 2;
|
|
813
|
-
continue;
|
|
814
|
-
}
|
|
815
|
-
if (source[i] === '"') {
|
|
816
|
-
i++;
|
|
817
|
-
break;
|
|
818
|
-
}
|
|
819
|
-
i++;
|
|
820
|
-
}
|
|
821
|
-
push("string", start2, Math.min(i, n));
|
|
822
|
-
continue;
|
|
823
|
-
}
|
|
824
|
-
if (c === "@") {
|
|
825
|
-
const start2 = i;
|
|
826
|
-
i++;
|
|
827
|
-
if (source[i] === "(") {
|
|
828
|
-
i++;
|
|
829
|
-
push("punct", start2, i);
|
|
830
|
-
continue;
|
|
831
|
-
}
|
|
832
|
-
const nameStart = i;
|
|
833
|
-
while (i < n && SIGIL_CONTINUE.test(source[i])) i++;
|
|
834
|
-
push("sigil", start2, i, source.slice(nameStart, i), nameStart);
|
|
835
|
-
continue;
|
|
836
|
-
}
|
|
837
|
-
if (c === "?") {
|
|
838
|
-
const start2 = i;
|
|
839
|
-
i++;
|
|
840
|
-
if (i < n && IDENT_START.test(source[i])) {
|
|
841
|
-
const nameStart = i;
|
|
842
|
-
while (i < n && SIGIL_CONTINUE.test(source[i])) i++;
|
|
843
|
-
push("payload-sigil", start2, i, source.slice(nameStart, i), nameStart);
|
|
844
|
-
} else {
|
|
845
|
-
push("payload-sigil", start2, i, "", i);
|
|
846
|
-
}
|
|
847
|
-
continue;
|
|
848
|
-
}
|
|
849
|
-
if (c === "-") {
|
|
850
|
-
const start2 = i;
|
|
851
|
-
if (source[i + 1] === ">") {
|
|
852
|
-
i += 2;
|
|
853
|
-
push("punct", start2, i);
|
|
854
|
-
} else if (source[i + 1] === "-") {
|
|
855
|
-
i += 2;
|
|
856
|
-
push("punct", start2, i);
|
|
857
|
-
} else if (source[i + 1] !== void 0 && DIGIT.test(source[i + 1])) {
|
|
858
|
-
i++;
|
|
859
|
-
while (i < n && (DIGIT.test(source[i]) || source[i] === ".")) i++;
|
|
860
|
-
push("number", start2, i);
|
|
861
|
-
} else {
|
|
862
|
-
i++;
|
|
863
|
-
push("identifier", start2, i);
|
|
864
|
-
}
|
|
865
|
-
continue;
|
|
866
|
-
}
|
|
867
|
-
if (DIGIT.test(c)) {
|
|
868
|
-
const start2 = i;
|
|
869
|
-
while (i < n && (DIGIT.test(source[i]) || source[i] === ".")) i++;
|
|
870
|
-
push("number", start2, i);
|
|
871
|
-
continue;
|
|
872
|
-
}
|
|
873
|
-
if (c === "=" || c === "!" || c === "<" || c === ">") {
|
|
874
|
-
const start2 = i;
|
|
875
|
-
i++;
|
|
876
|
-
if (source[i] === "=") i++;
|
|
877
|
-
const two = i - start2 === 2;
|
|
878
|
-
push(two ? "identifier" : "punct", start2, i);
|
|
879
|
-
continue;
|
|
880
|
-
}
|
|
881
|
-
if (c === "+" || c === "*" || c === "/" || c === "%") {
|
|
882
|
-
const start2 = i;
|
|
883
|
-
i++;
|
|
884
|
-
push("identifier", start2, i);
|
|
885
|
-
continue;
|
|
886
|
-
}
|
|
887
|
-
if (IDENT_START.test(c)) {
|
|
888
|
-
const start2 = i;
|
|
889
|
-
while (i < n && IDENT_CONTINUE.test(source[i])) i++;
|
|
890
|
-
const text = source.slice(start2, i);
|
|
891
|
-
push(text === "true" || text === "false" || text === "null" ? "literal" : "identifier", start2, i, text);
|
|
892
|
-
continue;
|
|
893
|
-
}
|
|
894
|
-
const start = i;
|
|
895
|
-
i++;
|
|
896
|
-
if (c === ":" && source[i] === ":") i++;
|
|
897
|
-
push("punct", start, i);
|
|
898
|
-
}
|
|
899
|
-
return tokens;
|
|
900
|
-
}
|
|
901
|
-
|
|
902
|
-
// src/i18n/localize.ts
|
|
903
|
-
var LOLO_SECTIONS = [
|
|
904
|
-
"keywords",
|
|
905
|
-
"shapes",
|
|
906
|
-
"tags",
|
|
907
|
-
"categories",
|
|
908
|
-
"capabilities",
|
|
909
|
-
"annotations",
|
|
910
|
-
"sigils",
|
|
911
|
-
"effects",
|
|
912
|
-
"types",
|
|
913
|
-
"units",
|
|
914
|
-
"literals",
|
|
915
|
-
"reservedEvents"
|
|
916
|
-
];
|
|
917
|
-
var CANON_ANY_ORDER = [
|
|
918
|
-
"keywords",
|
|
919
|
-
"shapes",
|
|
920
|
-
"tags",
|
|
921
|
-
"categories",
|
|
922
|
-
"capabilities",
|
|
923
|
-
"annotations",
|
|
924
|
-
"sigils",
|
|
925
|
-
"types",
|
|
926
|
-
"units",
|
|
927
|
-
"literals",
|
|
928
|
-
"reservedEvents"
|
|
929
|
-
];
|
|
930
|
-
function forward(lang, sections, resolutionOrder, operators) {
|
|
931
|
-
const canon = (native) => {
|
|
932
|
-
for (const section of resolutionOrder) {
|
|
933
|
-
for (const [english, value] of Object.entries(getVocabulary(lang)[section])) {
|
|
934
|
-
if (value === native) return english;
|
|
935
|
-
}
|
|
936
|
-
}
|
|
937
|
-
if (operators) {
|
|
938
|
-
for (const [english, value] of Object.entries(operators.operators)) {
|
|
939
|
-
if (value === native) return english;
|
|
940
|
-
}
|
|
941
|
-
}
|
|
942
|
-
return void 0;
|
|
943
|
-
};
|
|
944
|
-
const map = /* @__PURE__ */ new Map();
|
|
945
|
-
const add = (english, native) => {
|
|
946
|
-
if (canon(native) !== english) return;
|
|
947
|
-
map.set(english, native);
|
|
948
|
-
};
|
|
949
|
-
for (const section of sections) {
|
|
950
|
-
for (const [english, native] of Object.entries(getVocabulary(lang)[section])) {
|
|
951
|
-
add(english, native);
|
|
952
|
-
}
|
|
953
|
-
}
|
|
954
|
-
if (operators) {
|
|
955
|
-
for (const [english, native] of Object.entries(operators.operators)) {
|
|
956
|
-
add(english, native);
|
|
957
|
-
}
|
|
958
|
-
}
|
|
959
|
-
return map;
|
|
960
|
-
}
|
|
961
|
-
function localizeMap(lang, operators) {
|
|
962
|
-
return forward(lang, LOLO_SECTIONS, CANON_ANY_ORDER, operators);
|
|
963
|
-
}
|
|
964
|
-
function isWordShaped(english) {
|
|
965
|
-
return /^[A-Za-z_][A-Za-z0-9_/-]*$/.test(english);
|
|
966
|
-
}
|
|
967
|
-
var FIELD_BLOCK_HEADS = /* @__PURE__ */ new Set(["entity", "type", "config", "params", "variants", "tokens", "event"]);
|
|
968
|
-
var EVENT_BLOCK_HEADS = /* @__PURE__ */ new Set(["listens", "emits", "events"]);
|
|
969
|
-
var NAME_INTRODUCING = /* @__PURE__ */ new Set([
|
|
970
|
-
"app",
|
|
971
|
-
"orbital",
|
|
972
|
-
"entity",
|
|
973
|
-
"trait",
|
|
974
|
-
"state",
|
|
975
|
-
"page",
|
|
976
|
-
"type",
|
|
977
|
-
"event",
|
|
978
|
-
"uses",
|
|
979
|
-
"theme",
|
|
980
|
-
"as",
|
|
981
|
-
"extend"
|
|
982
|
-
]);
|
|
983
|
-
var NAME_PUNCT = /* @__PURE__ */ new Set(["->", "-->", "\u2192", ".", "--"]);
|
|
984
|
-
function localizeLoloSource(source, lang, options = {}) {
|
|
985
|
-
if (lang === "en") return source;
|
|
986
|
-
const { operators } = options;
|
|
987
|
-
const keywords = forward(lang, ["keywords"], CANON_ANY_ORDER);
|
|
988
|
-
const shapes = forward(lang, ["shapes"], CANON_ANY_ORDER);
|
|
989
|
-
const types = forward(lang, ["types"], ["types"]);
|
|
990
|
-
const modifiers = forward(lang, ["tags", "categories", "capabilities", "keywords"], CANON_ANY_ORDER);
|
|
991
|
-
const heads = forward(lang, ["effects"], ["effects"], operators);
|
|
992
|
-
const sigils = forward(lang, ["sigils", "annotations"], ["sigils", "annotations"]);
|
|
993
|
-
const bindingSigils = forward(lang, ["sigils"], ["sigils", "annotations"]);
|
|
994
|
-
const literals = forward(lang, ["literals"], ["literals"]);
|
|
995
|
-
const units = forward(lang, ["units"], ["units"]);
|
|
996
|
-
const reservedEvents = forward(lang, ["reservedEvents"], ["reservedEvents"]);
|
|
997
|
-
const tokens = lexLolo(source);
|
|
998
|
-
const edits = [];
|
|
999
|
-
const stack = [
|
|
1000
|
-
{
|
|
1001
|
-
kind: "root",
|
|
1002
|
-
stmtHead: void 0,
|
|
1003
|
-
blockHead: void 0,
|
|
1004
|
-
afterColon: false,
|
|
1005
|
-
sawEquals: false,
|
|
1006
|
-
refBody: false,
|
|
1007
|
-
parenHead: void 0,
|
|
1008
|
-
binderSeen: false
|
|
1009
|
-
}
|
|
1010
|
-
];
|
|
1011
|
-
const top = () => stack[stack.length - 1];
|
|
1012
|
-
let prev;
|
|
1013
|
-
const replace = (token, map) => {
|
|
1014
|
-
if (!isWordShaped(token.text)) return;
|
|
1015
|
-
const native = map.get(token.text);
|
|
1016
|
-
if (native === void 0 || native === token.text) return;
|
|
1017
|
-
edits.push({ start: token.textStart, end: token.end, text: native });
|
|
1018
|
-
};
|
|
1019
|
-
for (let index = 0; index < tokens.length; index++) {
|
|
1020
|
-
const token = tokens[index];
|
|
1021
|
-
if (token.kind === "comment") continue;
|
|
1022
|
-
const frame = top();
|
|
1023
|
-
const startsStatement = prev === void 0 || prev.text === "{" || prev.text === "}" || source.slice(prev.end, token.start).includes("\n");
|
|
1024
|
-
if (startsStatement) {
|
|
1025
|
-
frame.stmtHead = void 0;
|
|
1026
|
-
frame.afterColon = false;
|
|
1027
|
-
frame.sawEquals = false;
|
|
1028
|
-
}
|
|
1029
|
-
if (token.kind === "punct") {
|
|
1030
|
-
const text = source.slice(token.start, token.end);
|
|
1031
|
-
const child = (kind) => ({
|
|
1032
|
-
kind,
|
|
1033
|
-
stmtHead: void 0,
|
|
1034
|
-
blockHead: frame.stmtHead,
|
|
1035
|
-
afterColon: false,
|
|
1036
|
-
sawEquals: false,
|
|
1037
|
-
refBody: frame.refBody || frame.sawEquals,
|
|
1038
|
-
parenHead: void 0,
|
|
1039
|
-
binderSeen: false
|
|
1040
|
-
});
|
|
1041
|
-
if (text === "(" || text === "@(") {
|
|
1042
|
-
stack.push({ ...child(parenFrame(frame, prev)), blockHead: void 0 });
|
|
1043
|
-
if (top().kind === "binder-list") frame.binderSeen = true;
|
|
1044
|
-
} else if (text === "{") {
|
|
1045
|
-
stack.push(child(braceFrame(frame, prev)));
|
|
1046
|
-
} else if (text === "[") {
|
|
1047
|
-
stack.push(child(bracketFrame(frame, prev)));
|
|
1048
|
-
} else if (text === ")" || text === "}" || text === "]") {
|
|
1049
|
-
if (stack.length > 1) stack.pop();
|
|
1050
|
-
top().afterColon = false;
|
|
1051
|
-
top().sawEquals = false;
|
|
1052
|
-
} else if (text === ":") {
|
|
1053
|
-
frame.afterColon = true;
|
|
1054
|
-
} else if (text === "=") {
|
|
1055
|
-
frame.afterColon = false;
|
|
1056
|
-
frame.sawEquals = true;
|
|
1057
|
-
} else if (text === ",") {
|
|
1058
|
-
frame.afterColon = false;
|
|
1059
|
-
frame.sawEquals = false;
|
|
1060
|
-
frame.stmtHead = void 0;
|
|
1061
|
-
}
|
|
1062
|
-
prev = token;
|
|
1063
|
-
continue;
|
|
1064
|
-
}
|
|
1065
|
-
const opaque = frame.kind === "object" || frame.kind === "array" || frame.kind === "binder-list" || frame.kind === "binder-pair" && prev !== void 0 && prev.text === "(";
|
|
1066
|
-
if (token.kind === "sigil") {
|
|
1067
|
-
const dot = token.text.indexOf(".");
|
|
1068
|
-
const root = dot === -1 ? token.text : token.text.slice(0, dot);
|
|
1069
|
-
const native = (opaque || frame.kind === "paren" ? bindingSigils : sigils).get(root);
|
|
1070
|
-
if (native !== void 0 && native !== root) {
|
|
1071
|
-
edits.push({ start: token.textStart, end: token.textStart + root.length, text: native });
|
|
1072
|
-
}
|
|
1073
|
-
prev = token;
|
|
1074
|
-
continue;
|
|
1075
|
-
}
|
|
1076
|
-
if (token.kind === "payload-sigil" || token.kind === "string" || token.kind === "number") {
|
|
1077
|
-
prev = token;
|
|
1078
|
-
continue;
|
|
1079
|
-
}
|
|
1080
|
-
if (token.kind === "literal") {
|
|
1081
|
-
if (!opaque) replace(token, literals);
|
|
1082
|
-
prev = token;
|
|
1083
|
-
continue;
|
|
1084
|
-
}
|
|
1085
|
-
const prevText = prev === void 0 ? void 0 : source.slice(prev.start, prev.end);
|
|
1086
|
-
const afterName = prevText !== void 0 && (NAME_INTRODUCING.has(prevText) || NAME_PUNCT.has(prevText));
|
|
1087
|
-
if (token.text === "INIT" && !opaque && !frame.sawEquals) {
|
|
1088
|
-
replace(token, reservedEvents);
|
|
1089
|
-
if (frame.stmtHead === void 0) frame.stmtHead = token.text;
|
|
1090
|
-
prev = token;
|
|
1091
|
-
continue;
|
|
1092
|
-
}
|
|
1093
|
-
if (!opaque && !startsStatement && prev !== void 0 && prev.kind === "number") {
|
|
1094
|
-
replace(token, units);
|
|
1095
|
-
prev = token;
|
|
1096
|
-
continue;
|
|
1097
|
-
}
|
|
1098
|
-
switch (frame.kind) {
|
|
1099
|
-
case "paren": {
|
|
1100
|
-
if (prevText === "(") {
|
|
1101
|
-
frame.parenHead = token.text;
|
|
1102
|
-
replace(token, heads);
|
|
1103
|
-
}
|
|
1104
|
-
break;
|
|
1105
|
-
}
|
|
1106
|
-
case "binder-list":
|
|
1107
|
-
case "binder-pair":
|
|
1108
|
-
break;
|
|
1109
|
-
case "object":
|
|
1110
|
-
case "array":
|
|
1111
|
-
break;
|
|
1112
|
-
case "mods":
|
|
1113
|
-
if (!frame.afterColon) replace(token, modifiers);
|
|
1114
|
-
break;
|
|
1115
|
-
case "type-array":
|
|
1116
|
-
replace(token, types);
|
|
1117
|
-
break;
|
|
1118
|
-
case "block-fields": {
|
|
1119
|
-
if (frame.afterColon && !afterName) replace(token, types);
|
|
1120
|
-
break;
|
|
1121
|
-
}
|
|
1122
|
-
case "root":
|
|
1123
|
-
case "block-body": {
|
|
1124
|
-
if (!afterName) replace(token, frame.afterColon ? types : keywords);
|
|
1125
|
-
break;
|
|
1126
|
-
}
|
|
1127
|
-
}
|
|
1128
|
-
if ((frame.kind === "root" || frame.kind === "block-body") && prevText === "=") {
|
|
1129
|
-
replace(token, shapes);
|
|
1130
|
-
}
|
|
1131
|
-
if (frame.stmtHead === void 0) frame.stmtHead = token.text;
|
|
1132
|
-
prev = token;
|
|
1133
|
-
}
|
|
1134
|
-
return applyEdits(source, edits);
|
|
1135
|
-
}
|
|
1136
|
-
function parenFrame(frame, prev) {
|
|
1137
|
-
if (frame.kind === "binder-list") return "binder-pair";
|
|
1138
|
-
if (frame.kind === "paren" && !frame.binderSeen && prev !== void 0 && prev.text === frame.parenHead && (frame.parenHead === "let" || frame.parenHead === "fn" || frame.parenHead === "lambda")) {
|
|
1139
|
-
return "binder-list";
|
|
1140
|
-
}
|
|
1141
|
-
return "paren";
|
|
1142
|
-
}
|
|
1143
|
-
function braceFrame(frame, prev) {
|
|
1144
|
-
if (isExpression(frame.kind)) return "object";
|
|
1145
|
-
if (frame.kind === "block-fields" && prev !== void 0 && prev.text === "=") return "object";
|
|
1146
|
-
if (frame.refBody && frame.stmtHead === "config") return "object";
|
|
1147
|
-
if (frame.blockHead !== void 0 && EVENT_BLOCK_HEADS.has(frame.blockHead)) return "block-fields";
|
|
1148
|
-
if (frame.kind === "type-array") return "block-fields";
|
|
1149
|
-
if (frame.kind === "block-fields" && frame.afterColon) return "block-fields";
|
|
1150
|
-
const head = frame.stmtHead;
|
|
1151
|
-
return head !== void 0 && FIELD_BLOCK_HEADS.has(head) ? "block-fields" : "block-body";
|
|
1152
|
-
}
|
|
1153
|
-
function bracketFrame(frame, prev) {
|
|
1154
|
-
if (isExpression(frame.kind)) return "array";
|
|
1155
|
-
if (prev !== void 0 && prev.text === "=") return "array";
|
|
1156
|
-
if (frame.afterColon) return frame.kind === "block-fields" ? "type-array" : "array";
|
|
1157
|
-
return "mods";
|
|
1158
|
-
}
|
|
1159
|
-
function isExpression(kind) {
|
|
1160
|
-
return kind === "paren" || kind === "object" || kind === "array" || kind === "binder-list" || kind === "binder-pair";
|
|
1161
|
-
}
|
|
1162
|
-
function applyEdits(source, edits) {
|
|
1163
|
-
if (edits.length === 0) return source;
|
|
1164
|
-
edits.sort((a, b) => a.start - b.start);
|
|
1165
|
-
let out = "";
|
|
1166
|
-
let cursor = 0;
|
|
1167
|
-
for (const edit of edits) {
|
|
1168
|
-
if (edit.start < cursor) continue;
|
|
1169
|
-
out += source.slice(cursor, edit.start) + edit.text;
|
|
1170
|
-
cursor = edit.end;
|
|
1171
|
-
}
|
|
1172
|
-
return out + source.slice(cursor);
|
|
1173
|
-
}
|
|
1174
|
-
function localizeOrbValue(value, lang, options = {}) {
|
|
1175
|
-
if (lang === "en") return value;
|
|
1176
|
-
const orbKeys = forward(lang, ["orb"], ["orb"]);
|
|
1177
|
-
const types = forward(lang, ["types"], ["types"]);
|
|
1178
|
-
const tags = forward(lang, ["tags"], ["tags"]);
|
|
1179
|
-
const heads = forward(lang, ["effects"], ["effects"], options.operators);
|
|
1180
|
-
const sigils = forward(lang, ["sigils"], ["sigils", "annotations"]);
|
|
1181
|
-
const walk = (node, inExpression) => {
|
|
1182
|
-
if (Array.isArray(node)) {
|
|
1183
|
-
const head = node[0];
|
|
1184
|
-
const native = typeof head === "string" ? heads.get(head) : void 0;
|
|
1185
|
-
const isExpression2 = native !== void 0;
|
|
1186
|
-
const items = node.map(
|
|
1187
|
-
(child, index) => index === 0 && isExpression2 ? child : walk(child, inExpression || isExpression2)
|
|
1188
|
-
);
|
|
1189
|
-
if (native !== void 0) items[0] = native;
|
|
1190
|
-
return items;
|
|
1191
|
-
}
|
|
1192
|
-
if (node !== null && typeof node === "object") {
|
|
1193
|
-
const out = {};
|
|
1194
|
-
for (const [key, child] of Object.entries(node)) {
|
|
1195
|
-
const nativeKey = orbKeys.get(key) ?? key;
|
|
1196
|
-
let next = walk(child, inExpression);
|
|
1197
|
-
if (typeof next === "string") {
|
|
1198
|
-
if (key === "type" && !inExpression) next = types.get(next) ?? next;
|
|
1199
|
-
else if (key === "persistence") next = tags.get(next) ?? next;
|
|
1200
|
-
}
|
|
1201
|
-
out[nativeKey] = next;
|
|
1202
|
-
}
|
|
1203
|
-
return out;
|
|
1204
|
-
}
|
|
1205
|
-
if (typeof node === "string" && node.startsWith("@")) {
|
|
1206
|
-
const rest = node.slice(1);
|
|
1207
|
-
const dot = rest.indexOf(".");
|
|
1208
|
-
const root = dot === -1 ? rest : rest.slice(0, dot);
|
|
1209
|
-
const native = sigils.get(root);
|
|
1210
|
-
if (native === void 0) return node;
|
|
1211
|
-
return dot === -1 ? `@${native}` : `@${native}${rest.slice(dot)}`;
|
|
1212
|
-
}
|
|
1213
|
-
return node;
|
|
1214
|
-
};
|
|
1215
|
-
return walk(value, false);
|
|
1216
|
-
}
|
|
1217
|
-
|
|
1218
|
-
// src/i18n/index.ts
|
|
1219
|
-
var RTL_LOCALES = ["ar", "he", "fa", "ur"];
|
|
1220
|
-
function localeDirection(locale) {
|
|
1221
|
-
return RTL_LOCALES.includes(locale) ? "rtl" : "ltr";
|
|
1222
|
-
}
|
|
1223
|
-
function pathLocale(path, locales) {
|
|
1224
|
-
const first = path.replace(/^\/+/, "").split("/")[0] ?? "";
|
|
1225
|
-
return locales.find((l) => l === first);
|
|
1226
|
-
}
|
|
1227
|
-
function localeOfPath(path, locales) {
|
|
1228
|
-
return pathLocale(path, locales) ?? locales[0];
|
|
1229
|
-
}
|
|
1230
|
-
function localeAlternates(pages, page, locales) {
|
|
1231
|
-
const indexable = (p) => p.access === "public" && p.indexing !== "noindex";
|
|
1232
|
-
const group = (p) => p.translationOf ?? p.sourcePage;
|
|
1233
|
-
const key = group(page);
|
|
1234
|
-
if (!indexable(page) || key === void 0) return void 0;
|
|
1235
|
-
const byLocale = [];
|
|
1236
|
-
for (const other of pages) {
|
|
1237
|
-
if (group(other) !== key || !indexable(other)) continue;
|
|
1238
|
-
const locale = localeOfPath(other.path, locales);
|
|
1239
|
-
if (locale === void 0 || byLocale.some((a) => a.locale === locale)) return void 0;
|
|
1240
|
-
byLocale.push({ locale, path: other.path });
|
|
1241
|
-
}
|
|
1242
|
-
if (byLocale.length < 2) return void 0;
|
|
1243
|
-
return byLocale.sort((a, b) => locales.indexOf(a.locale) - locales.indexOf(b.locale));
|
|
1244
|
-
}
|
|
1245
|
-
var I18N_SECTIONS = [
|
|
1246
|
-
"keywords",
|
|
1247
|
-
"shapes",
|
|
1248
|
-
"tags",
|
|
1249
|
-
"categories",
|
|
1250
|
-
"capabilities",
|
|
1251
|
-
"annotations",
|
|
1252
|
-
"sigils",
|
|
1253
|
-
"effects",
|
|
1254
|
-
"types",
|
|
1255
|
-
"units",
|
|
1256
|
-
"literals",
|
|
1257
|
-
"reservedEvents",
|
|
1258
|
-
"orb"
|
|
1259
|
-
];
|
|
1260
|
-
function isPlainObject(x) {
|
|
1261
|
-
return typeof x === "object" && x !== null && !Array.isArray(x);
|
|
1262
|
-
}
|
|
1263
|
-
function isRawI18nTable(x) {
|
|
1264
|
-
return isPlainObject(x);
|
|
1265
|
-
}
|
|
1266
|
-
function isStringRecord(x) {
|
|
1267
|
-
if (!isPlainObject(x)) return false;
|
|
1268
|
-
for (const value of Object.values(x)) {
|
|
1269
|
-
if (typeof value !== "string") return false;
|
|
1270
|
-
}
|
|
1271
|
-
return true;
|
|
1272
|
-
}
|
|
1273
|
-
var LANGUAGE_CODE = /^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$/;
|
|
1274
|
-
function isLanguageCode(x) {
|
|
1275
|
-
return typeof x === "string" && LANGUAGE_CODE.test(x);
|
|
1276
|
-
}
|
|
1277
|
-
function isI18nMeta(x) {
|
|
1278
|
-
if (!isPlainObject(x) || !("code" in x) || !("name" in x) || !("rtl" in x)) return false;
|
|
1279
|
-
return isLanguageCode(x.code) && typeof x.name === "string" && typeof x.rtl === "boolean";
|
|
1280
|
-
}
|
|
1281
|
-
function emptySections() {
|
|
1282
|
-
return {
|
|
1283
|
-
keywords: {},
|
|
1284
|
-
shapes: {},
|
|
1285
|
-
tags: {},
|
|
1286
|
-
categories: {},
|
|
1287
|
-
capabilities: {},
|
|
1288
|
-
annotations: {},
|
|
1289
|
-
sigils: {},
|
|
1290
|
-
effects: {},
|
|
1291
|
-
types: {},
|
|
1292
|
-
units: {},
|
|
1293
|
-
literals: {},
|
|
1294
|
-
reservedEvents: {},
|
|
1295
|
-
orb: {}
|
|
1296
|
-
};
|
|
1297
|
-
}
|
|
1298
|
-
function parseI18nTables(raw, source) {
|
|
1299
|
-
if (!isRawI18nTable(raw)) {
|
|
1300
|
-
throw new Error(`i18n table "${source}": expected a JSON object, got ${typeof raw}`);
|
|
1301
|
-
}
|
|
1302
|
-
if (!isI18nMeta(raw.meta)) {
|
|
1303
|
-
throw new Error(`i18n table "${source}": missing or malformed "meta" (expected { code, name, rtl })`);
|
|
1304
|
-
}
|
|
1305
|
-
const badSections = [];
|
|
1306
|
-
const sections = emptySections();
|
|
1307
|
-
for (const section of I18N_SECTIONS) {
|
|
1308
|
-
const value = raw[section];
|
|
1309
|
-
if (value === void 0) continue;
|
|
1310
|
-
if (!isStringRecord(value)) {
|
|
1311
|
-
badSections.push(section);
|
|
1312
|
-
continue;
|
|
1313
|
-
}
|
|
1314
|
-
sections[section] = value;
|
|
1315
|
-
}
|
|
1316
|
-
if (badSections.length > 0) {
|
|
1317
|
-
throw new Error(`i18n table "${source}": sections not Record<string,string>: ${badSections.join(", ")}`);
|
|
1318
|
-
}
|
|
1319
|
-
return { meta: raw.meta, ...sections };
|
|
1320
|
-
}
|
|
1321
|
-
function parseNotationKeys(raw, source) {
|
|
1322
|
-
if (!isPlainObject(raw) || !("keys" in raw) || !Array.isArray(raw.keys)) {
|
|
1323
|
-
throw new Error(`notation file "${source}": expected { keys: string[] }`);
|
|
1324
|
-
}
|
|
1325
|
-
const keys = [];
|
|
1326
|
-
for (const key of raw.keys) {
|
|
1327
|
-
if (typeof key !== "string") {
|
|
1328
|
-
throw new Error(`notation file "${source}": every key must be a string`);
|
|
1329
|
-
}
|
|
1330
|
-
keys.push(key);
|
|
1331
|
-
}
|
|
1332
|
-
return keys;
|
|
1333
|
-
}
|
|
1334
|
-
function parseOperatorTables(raw, source) {
|
|
1335
|
-
if (!isPlainObject(raw) || !("operators" in raw) || !isStringRecord(raw.operators)) {
|
|
1336
|
-
throw new Error(`operator table "${source}": expected { operators: Record<string,string> }`);
|
|
1337
|
-
}
|
|
1338
|
-
return { operators: raw.operators };
|
|
1339
|
-
}
|
|
1340
|
-
var ORB_NOTATION_KEYS = new Set(
|
|
1341
|
-
parseNotationKeys(orb_notation_default, "orb-notation.json")
|
|
1342
|
-
);
|
|
1343
|
-
var englishTables = parseI18nTables(en_default, "en.json");
|
|
1344
|
-
function parseVocabularyPack(raw, source) {
|
|
1345
|
-
const tables = parseI18nTables(raw, source);
|
|
1346
|
-
const { operators } = parseOperatorTables(raw, source);
|
|
1347
|
-
return { ...tables, operators };
|
|
1348
|
-
}
|
|
1349
|
-
var registeredPacks = /* @__PURE__ */ new Map();
|
|
1350
|
-
var FATAL_PACK_PROBLEMS = /* @__PURE__ */ new Set(["collision", "selector-not-unique", "inconsistent", "empty"]);
|
|
1351
|
-
function registerVocabulary(pack) {
|
|
1352
|
-
const code = pack.meta.code;
|
|
1353
|
-
if (code === "en") throw new Error('language pack "en": English is built in and cannot be replaced');
|
|
1354
|
-
const existing = registeredPacks.get(code);
|
|
1355
|
-
if (existing) {
|
|
1356
|
-
if (JSON.stringify(existing) === JSON.stringify(pack)) return;
|
|
1357
|
-
throw new Error(`language pack "${code}": a different "${code}" pack is already installed`);
|
|
1358
|
-
}
|
|
1359
|
-
const core = { en: englishTables };
|
|
1360
|
-
for (const [other, table] of registeredPacks) core[other] = table;
|
|
1361
|
-
core[code] = pack;
|
|
1362
|
-
const std = {};
|
|
1363
|
-
for (const [other, table] of registeredPacks) std[other] = { operators: table.operators };
|
|
1364
|
-
std[code] = { operators: pack.operators };
|
|
1365
|
-
const fatal = checkI18nCoverage({ core, std }).problems.filter((p) => p.lang === code && FATAL_PACK_PROBLEMS.has(p.kind));
|
|
1366
|
-
if (fatal.length > 0) {
|
|
1367
|
-
const lines = fatal.map((p) => `${p.kind} ${p.section}.${p.key}${p.detail ? ` \u2014 ${p.detail}` : ""}`);
|
|
1368
|
-
throw new Error(`language pack "${code}" is refused:
|
|
1369
|
-
${lines.join("\n ")}`);
|
|
1370
|
-
}
|
|
1371
|
-
registeredPacks.set(code, pack);
|
|
1372
|
-
}
|
|
1373
|
-
function installedLanguages() {
|
|
1374
|
-
return ["en", ...[...registeredPacks.keys()].sort()];
|
|
1375
|
-
}
|
|
1376
|
-
function getVocabulary(lang) {
|
|
1377
|
-
if (lang === "en") return englishTables;
|
|
1378
|
-
const pack = registeredPacks.get(lang);
|
|
1379
|
-
if (!pack) {
|
|
1380
|
-
throw new Error(`language "${lang}" is not installed \u2014 install its language pack (\`orb language install <package>\`) and register it`);
|
|
1381
|
-
}
|
|
1382
|
-
return pack;
|
|
1383
|
-
}
|
|
1384
|
-
function vocabularyOperators(lang) {
|
|
1385
|
-
const pack = registeredPacks.get(lang);
|
|
1386
|
-
return pack ? { operators: pack.operators } : void 0;
|
|
1387
|
-
}
|
|
1388
|
-
function aliasMap(lang, section, operators) {
|
|
1389
|
-
let table;
|
|
1390
|
-
if (section === "operators") {
|
|
1391
|
-
if (!operators) {
|
|
1392
|
-
throw new Error(`aliasMap("${lang}", "operators") requires an OperatorTables argument`);
|
|
1393
|
-
}
|
|
1394
|
-
table = operators.operators;
|
|
1395
|
-
} else {
|
|
1396
|
-
table = getVocabulary(lang)[section];
|
|
1397
|
-
}
|
|
1398
|
-
const map = /* @__PURE__ */ new Map();
|
|
1399
|
-
for (const [english, native] of Object.entries(table)) {
|
|
1400
|
-
map.set(native, english);
|
|
1401
|
-
}
|
|
1402
|
-
return map;
|
|
1403
|
-
}
|
|
1404
|
-
var LOLO_FIRST_TOKEN_KEYWORDS = ["app", "uses", "expects", "type", "theme", "orbital"];
|
|
1405
|
-
function languageOfLoloFirstToken(token) {
|
|
1406
|
-
const matches = installedLanguages().filter(
|
|
1407
|
-
(lang) => LOLO_FIRST_TOKEN_KEYWORDS.some((kw) => getVocabulary(lang).keywords[kw] === token)
|
|
1408
|
-
);
|
|
1409
|
-
return matches.length === 1 ? matches[0] : void 0;
|
|
1410
|
-
}
|
|
1411
|
-
function languageOfOrbTopLevelKeys(keys) {
|
|
1412
|
-
const keySet = new Set(keys);
|
|
1413
|
-
const matches = installedLanguages().filter((lang) => keySet.has(getVocabulary(lang).orb.orbitals));
|
|
1414
|
-
return matches.length === 1 ? matches[0] : void 0;
|
|
1415
|
-
}
|
|
1416
|
-
function checkI18nCoverage(input) {
|
|
1417
|
-
const problems = [];
|
|
1418
|
-
const { core, std, canonicalOperators } = input;
|
|
1419
|
-
const enTable = core.en;
|
|
1420
|
-
for (const lang of Object.keys(core)) {
|
|
1421
|
-
for (const key of Object.keys(core[lang].orb)) {
|
|
1422
|
-
if (ORB_NOTATION_KEYS.has(key)) {
|
|
1423
|
-
problems.push({
|
|
1424
|
-
lang,
|
|
1425
|
-
section: "orb",
|
|
1426
|
-
kind: "notation-in-vocabulary",
|
|
1427
|
-
key,
|
|
1428
|
-
detail: "design-system token name \u2014 notation, not language vocabulary"
|
|
1429
|
-
});
|
|
1430
|
-
}
|
|
1431
|
-
}
|
|
1432
|
-
}
|
|
1433
|
-
for (const lang of Object.keys(core)) {
|
|
1434
|
-
const table = core[lang];
|
|
1435
|
-
for (const section of I18N_SECTIONS) {
|
|
1436
|
-
const values = table[section];
|
|
1437
|
-
if (lang !== "en") {
|
|
1438
|
-
const enKeys = new Set(Object.keys(enTable[section]));
|
|
1439
|
-
const langKeys = new Set(Object.keys(values));
|
|
1440
|
-
for (const key of enKeys) {
|
|
1441
|
-
if (!langKeys.has(key)) {
|
|
1442
|
-
problems.push({ lang, section, kind: "missing", key });
|
|
1443
|
-
}
|
|
1444
|
-
}
|
|
1445
|
-
for (const key of langKeys) {
|
|
1446
|
-
if (!enKeys.has(key)) {
|
|
1447
|
-
problems.push({ lang, section, kind: "orphan", key });
|
|
1448
|
-
}
|
|
1449
|
-
}
|
|
1450
|
-
}
|
|
1451
|
-
for (const [key, value] of Object.entries(values)) {
|
|
1452
|
-
if (value === "") {
|
|
1453
|
-
problems.push({ lang, section, kind: "empty", key });
|
|
1454
|
-
}
|
|
1455
|
-
}
|
|
1456
|
-
}
|
|
1457
|
-
}
|
|
1458
|
-
for (const lang of Object.keys(core)) {
|
|
1459
|
-
const table = core[lang];
|
|
1460
|
-
const occurrences = /* @__PURE__ */ new Map();
|
|
1461
|
-
for (const section of I18N_SECTIONS) {
|
|
1462
|
-
for (const [key, value] of Object.entries(table[section])) {
|
|
1463
|
-
const list = occurrences.get(key) ?? [];
|
|
1464
|
-
list.push({ section, value });
|
|
1465
|
-
occurrences.set(key, list);
|
|
1466
|
-
}
|
|
1467
|
-
}
|
|
1468
|
-
const opTable = std?.[lang]?.operators;
|
|
1469
|
-
if (opTable) {
|
|
1470
|
-
for (const [key, value] of Object.entries(opTable)) {
|
|
1471
|
-
const list = occurrences.get(key) ?? [];
|
|
1472
|
-
list.push({ section: "operators", value });
|
|
1473
|
-
occurrences.set(key, list);
|
|
1474
|
-
}
|
|
1475
|
-
}
|
|
1476
|
-
for (const [key, entries] of occurrences) {
|
|
1477
|
-
if (entries.length < 2) continue;
|
|
1478
|
-
const baseline = entries[0];
|
|
1479
|
-
for (let i = 1; i < entries.length; i++) {
|
|
1480
|
-
const entry = entries[i];
|
|
1481
|
-
if (entry.value !== baseline.value) {
|
|
1482
|
-
problems.push({
|
|
1483
|
-
lang,
|
|
1484
|
-
section: entry.section,
|
|
1485
|
-
kind: "inconsistent",
|
|
1486
|
-
key,
|
|
1487
|
-
detail: `"${key}" is "${baseline.value}" in ${baseline.section} but "${entry.value}" in ${entry.section}`
|
|
1488
|
-
});
|
|
1489
|
-
}
|
|
1490
|
-
}
|
|
1491
|
-
}
|
|
1492
|
-
}
|
|
1493
|
-
for (const lang of Object.keys(core)) {
|
|
1494
|
-
const table = core[lang];
|
|
1495
|
-
for (const section of I18N_SECTIONS) {
|
|
1496
|
-
const byValue = /* @__PURE__ */ new Map();
|
|
1497
|
-
for (const [key, value] of Object.entries(table[section])) {
|
|
1498
|
-
const keys = byValue.get(value) ?? [];
|
|
1499
|
-
keys.push(key);
|
|
1500
|
-
byValue.set(value, keys);
|
|
1501
|
-
}
|
|
1502
|
-
for (const [value, keys] of byValue) {
|
|
1503
|
-
if (keys.length < 2) continue;
|
|
1504
|
-
for (let i = 1; i < keys.length; i++) {
|
|
1505
|
-
problems.push({
|
|
1506
|
-
lang,
|
|
1507
|
-
section,
|
|
1508
|
-
kind: "collision",
|
|
1509
|
-
key: keys[i],
|
|
1510
|
-
detail: `shares native value "${value}" with "${keys[0]}" in ${section}`
|
|
1511
|
-
});
|
|
1512
|
-
}
|
|
1513
|
-
}
|
|
1514
|
-
}
|
|
1515
|
-
const combined = /* @__PURE__ */ new Map();
|
|
1516
|
-
for (const [key, value] of Object.entries(table.effects)) {
|
|
1517
|
-
const list = combined.get(value) ?? [];
|
|
1518
|
-
list.push({ section: "effects", key });
|
|
1519
|
-
combined.set(value, list);
|
|
1520
|
-
}
|
|
1521
|
-
const opTable = std?.[lang]?.operators;
|
|
1522
|
-
if (opTable) {
|
|
1523
|
-
for (const [key, value] of Object.entries(opTable)) {
|
|
1524
|
-
const list = combined.get(value) ?? [];
|
|
1525
|
-
list.push({ section: "operators", key });
|
|
1526
|
-
combined.set(value, list);
|
|
1527
|
-
}
|
|
1528
|
-
}
|
|
1529
|
-
for (const [value, entries] of combined) {
|
|
1530
|
-
const hasEffects = entries.some((e) => e.section === "effects");
|
|
1531
|
-
const hasOperators = entries.some((e) => e.section === "operators");
|
|
1532
|
-
if (!(hasEffects && hasOperators)) continue;
|
|
1533
|
-
const first = entries[0];
|
|
1534
|
-
for (const entry of entries.slice(1)) {
|
|
1535
|
-
if (entry.key === first.key) continue;
|
|
1536
|
-
problems.push({
|
|
1537
|
-
lang,
|
|
1538
|
-
section: "effects\u222Aoperators",
|
|
1539
|
-
kind: "collision",
|
|
1540
|
-
key: entry.key,
|
|
1541
|
-
detail: `shares native value "${value}" with "${first.key}" (${first.section}) in effects\u222Aoperators`
|
|
1542
|
-
});
|
|
1543
|
-
}
|
|
1544
|
-
}
|
|
1545
|
-
}
|
|
1546
|
-
const selectorUses = /* @__PURE__ */ new Map();
|
|
1547
|
-
for (const lang of Object.keys(core)) {
|
|
1548
|
-
const table = core[lang];
|
|
1549
|
-
const selectors = [
|
|
1550
|
-
...LOLO_FIRST_TOKEN_KEYWORDS.map((key) => ({ section: "keywords", key, value: table.keywords[key] })),
|
|
1551
|
-
{ section: "orb", key: "orbitals", value: table.orb.orbitals }
|
|
1552
|
-
];
|
|
1553
|
-
for (const { section, key, value } of selectors) {
|
|
1554
|
-
if (value === void 0) continue;
|
|
1555
|
-
const uses = selectorUses.get(value) ?? [];
|
|
1556
|
-
uses.push({ lang, section, key });
|
|
1557
|
-
selectorUses.set(value, uses);
|
|
1558
|
-
}
|
|
1559
|
-
}
|
|
1560
|
-
for (const [value, uses] of selectorUses) {
|
|
1561
|
-
const langs = new Set(uses.map((u) => u.lang));
|
|
1562
|
-
if (langs.size < 2) continue;
|
|
1563
|
-
for (const use of uses) {
|
|
1564
|
-
const others = uses.filter((u) => u.lang !== use.lang).map((u) => `${u.lang}:${u.section}.${u.key}`);
|
|
1565
|
-
problems.push({
|
|
1566
|
-
lang: use.lang,
|
|
1567
|
-
section: use.section,
|
|
1568
|
-
kind: "selector-not-unique",
|
|
1569
|
-
key: use.key,
|
|
1570
|
-
detail: `${use.section}.${use.key} = "${value}" is also a language selector in: ${others.join(", ")}`
|
|
1571
|
-
});
|
|
1572
|
-
}
|
|
1573
|
-
}
|
|
1574
|
-
if (std && canonicalOperators) {
|
|
1575
|
-
const canonicalSet = new Set(canonicalOperators);
|
|
1576
|
-
for (const lang of Object.keys(core)) {
|
|
1577
|
-
const opTable = std[lang]?.operators;
|
|
1578
|
-
if (!opTable) continue;
|
|
1579
|
-
const langKeys = new Set(Object.keys(opTable));
|
|
1580
|
-
for (const op of canonicalSet) {
|
|
1581
|
-
if (!langKeys.has(op)) {
|
|
1582
|
-
problems.push({ lang, section: "operators", kind: "operators-mismatch", key: op, detail: "missing from language operator table" });
|
|
1583
|
-
}
|
|
1584
|
-
}
|
|
1585
|
-
for (const op of langKeys) {
|
|
1586
|
-
if (!canonicalSet.has(op)) {
|
|
1587
|
-
problems.push({ lang, section: "operators", kind: "operators-mismatch", key: op, detail: "not present in canonical operator set" });
|
|
1588
|
-
}
|
|
1589
|
-
}
|
|
1590
|
-
}
|
|
1591
|
-
}
|
|
1592
|
-
return { ok: problems.length === 0, problems };
|
|
1593
|
-
}
|
|
1594
|
-
function reportIdenticalToEnglish(input) {
|
|
1595
|
-
const problems = [];
|
|
1596
|
-
const enTable = input.core.en;
|
|
1597
|
-
for (const lang of Object.keys(input.core)) {
|
|
1598
|
-
if (lang === "en") continue;
|
|
1599
|
-
const table = input.core[lang];
|
|
1600
|
-
for (const section of I18N_SECTIONS) {
|
|
1601
|
-
for (const [key, value] of Object.entries(table[section])) {
|
|
1602
|
-
const enValue = enTable[section][key];
|
|
1603
|
-
if (enValue !== void 0 && value === enValue) {
|
|
1604
|
-
problems.push({ lang, section, kind: "identical-to-english", key, detail: `matches English value "${enValue}"` });
|
|
1605
|
-
}
|
|
1606
|
-
}
|
|
1607
|
-
}
|
|
1608
|
-
}
|
|
1609
|
-
return problems;
|
|
1610
|
-
}
|
|
1611
|
-
|
|
1612
|
-
export { I18N_SECTIONS, LOLO_FIRST_TOKEN_KEYWORDS, ORB_NOTATION_KEYS, RTL_LOCALES, aliasMap, checkI18nCoverage, englishTables, getVocabulary, installedLanguages, languageOfLoloFirstToken, languageOfOrbTopLevelKeys, lexLolo, localeAlternates, localeDirection, localeOfPath, localizeLoloSource, localizeMap, localizeOrbValue, parseI18nTables, parseOperatorTables, parseVocabularyPack, pathLocale, registerVocabulary, reportIdenticalToEnglish, vocabularyOperators };
|
|
1613
|
-
//# sourceMappingURL=chunk-JOHDVS6J.js.map
|
|
1614
|
-
//# sourceMappingURL=chunk-JOHDVS6J.js.map
|