@veroxm/react-sdk 1.10.0 → 1.11.1

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.
@@ -0,0 +1,491 @@
1
+ // The on-page editor's own words, in English and Arabic, and the dashboard's slot editor reads the same table
2
+ // (apps/web imports this file), so both places say the same thing.
3
+ //
4
+ // const ui = createTranslator('ar', { digits: 'latn' });
5
+ // ui.t('list.count', { n: 4, max: 6 }) // "4 من 6 عناصر"
6
+ // ui.t('text.count', { n: 25, max: 80 }) // "25 / 80" (render it isolated, left to right: see the panel)
7
+ //
8
+ // - {name} is replaced by vars.name. Numbers are written with the interface's digits (Intl.NumberFormat): Latin
9
+ // (0123) by default, Arabic-Indic (٠١٢٣) when chosen. Everything else is inserted as given.
10
+ // - A message can be plural: one form per Intl.PluralRules category (Arabic has six: zero, one, two, few, many,
11
+ // other). `by` names the variable that picks the form (default `n`).
12
+ // - A key missing from Arabic falls back to English; a key missing everywhere shows the key itself.
13
+ //
14
+ // Pure, no imports: the SDK, the script tag and the dashboard all bundle it.
15
+ export const EDITOR_LANGS = ['en', 'ar'];
16
+ /** How each interface language names itself (the switch in the editing bar). */
17
+ export const LANG_NAMES = { en: 'English', ar: 'العربية' };
18
+ const en = {
19
+ // the editing bar
20
+ 'bar.aria': 'VeroXM editor',
21
+ 'bar.editing': 'Editing drafts',
22
+ 'bar.ended': 'Editing ended',
23
+ 'bar.clickOn': 'Click to edit: on',
24
+ 'bar.clickOff': 'Click to edit: off',
25
+ 'bar.slots': 'Slots on this page',
26
+ 'bar.exit': 'Exit',
27
+ 'bar.language': 'Interface language',
28
+ 'bar.digits': 'Digits',
29
+ 'bar.digitsLatn': 'Latin digits (0123)',
30
+ 'bar.digitsArab': 'Arabic-Indic digits (٠١٢٣)',
31
+ 'list.empty': 'No slots are visible on this page.',
32
+ 'inline.keys': 'Enter to save · Esc to cancel',
33
+ 'inline.aria': '{label} (editing – Enter to save, Escape to cancel)',
34
+ // errors
35
+ 'error.unreachable': 'VeroXM could not be reached.',
36
+ 'error.http': 'Something went wrong (HTTP {status}).',
37
+ 'error.save': 'Could not save. Check your connection.',
38
+ 'error.generic': 'Something went wrong. Try again.',
39
+ 'error.discard': 'Could not discard.',
40
+ 'error.unknownSlot': 'VeroXM doesn’t know this slot yet. Reload the page so the site can report it, then try again.',
41
+ // the panel
42
+ 'panel.close': 'Close',
43
+ 'panel.live': 'v{version} live',
44
+ 'panel.neverPublished': 'never published',
45
+ 'panel.loading': 'Loading…',
46
+ 'panel.inherited': 'Nothing saved in {locale} yet; you’re starting from the default language’s published copy.',
47
+ 'seed.filled': 'Filled from the page’s current content ({fields}). Change what you need, then publish.',
48
+ 'seed.inheritedSplit': 'Nothing saved in {locale} yet. From this page’s {locale} content: {fields}. From the default language’s published copy: {rest}.',
49
+ 'seed.inheritedAll': 'Nothing saved in {locale} yet. Filled from this page’s {locale} content ({fields}). Change what you need, then publish.',
50
+ 'fill.offer': 'Empty here, but the page shows content for: {fields}.',
51
+ 'fill.button': 'Fill empty fields from the page',
52
+ 'fill.done': 'Filled {fields} from the page. Change what you need, then publish.',
53
+ 'list.separator': ', ',
54
+ // saving, publishing
55
+ 'status.savingVariant': 'Saving variant…',
56
+ 'status.savingDraft': 'Saving draft…',
57
+ 'status.variantSaved': 'Variant saved',
58
+ 'status.draftSaved': 'Draft saved',
59
+ 'status.editing': 'Editing… saves in a moment',
60
+ 'status.unpublished': 'Unpublished changes',
61
+ 'status.clean': 'No unpublished changes',
62
+ 'notice.discarded': 'Changes discarded.',
63
+ 'outcome.published': 'Published. Visitors see this now.',
64
+ 'outcome.submitted': 'Sent for approval. Nothing changes for visitors until it is approved.',
65
+ 'outcome.approved': 'Approved. It moves to the next step.',
66
+ 'outcome.rejected': 'Rejected. The author can change it and send it again.',
67
+ 'outcome.withdrawn': 'Request withdrawn. Your draft is unchanged.',
68
+ 'publish.button': 'Publish',
69
+ 'publish.busy': 'Publishing…',
70
+ 'publish.send': 'Send for approval',
71
+ 'publish.sending': 'Sending…',
72
+ 'publish.noPermission': 'Someone with publish permission can make this live.',
73
+ 'discard.button': 'Discard changes',
74
+ 'discard.confirm': 'Discard all changes?',
75
+ 'discard.busy': 'Discarding…',
76
+ // approvals
77
+ 'approval.aria': 'Approval',
78
+ 'approval.waiting': 'Waiting for approval',
79
+ 'approval.step': 'step {n} of {total}',
80
+ 'approval.sentBy': 'sent by {name}',
81
+ 'approval.changed': 'Edits made since it was sent aren’t part of the request.',
82
+ 'approval.comment': 'Comment (needed to reject)',
83
+ 'approval.approve': 'Approve',
84
+ 'approval.approvePublish': 'Approve and publish',
85
+ 'approval.approving': 'Approving…',
86
+ 'approval.reject': 'Reject',
87
+ 'approval.rejecting': 'Rejecting…',
88
+ 'approval.other': 'Someone else on that step’s role approves it.',
89
+ 'approval.withdraw': 'Withdraw request',
90
+ 'approval.withdrawing': 'Withdrawing…',
91
+ // A/B tests
92
+ 'test.draft': 'Test draft',
93
+ 'test.pending_approval': 'Test waiting for approval',
94
+ 'test.live': 'Test running',
95
+ 'test.paused': 'Test paused',
96
+ 'test.generic': 'Test',
97
+ 'test.versions': 'Version to show and edit',
98
+ 'test.published': 'Published',
99
+ 'test.editable': 'The page shows this variant. Edits change only this variant; empty fields use the published version.',
100
+ 'test.noPermission': 'The page shows this variant. Editing variants needs permission to manage experiments.',
101
+ 'test.locked': 'The page shows this variant. Variants can’t change once the test has started.',
102
+ 'test.settings': 'Test settings and results',
103
+ 'test.back': 'Back to published',
104
+ // fields
105
+ 'text.count': '{n} / {max}',
106
+ 'common.remove': 'Remove',
107
+ 'common.removeItem': 'Remove {title}',
108
+ 'common.moveEarlier': 'Move {title} earlier',
109
+ 'common.moveLater': 'Move {title} later',
110
+ 'common.title': 'Title',
111
+ 'common.text': 'Text',
112
+ 'common.address': 'Address',
113
+ 'common.name': 'Name',
114
+ 'common.pagePlaceholder': 'https://… or /page',
115
+ 'common.pagePlaceholderShort': '/page or https://…',
116
+ 'link.text': 'Text',
117
+ 'link.address': 'Address',
118
+ 'component.label': 'Component',
119
+ 'component.choose': 'Choose a component',
120
+ 'component.none': 'None (the site’s default)',
121
+ 'video.url': 'YouTube or Vimeo link, or a video file',
122
+ 'video.empty': 'The page shows it as a player.',
123
+ 'video.recognised': '{provider}: recognised.',
124
+ 'video.file': 'Video file',
125
+ 'video.bad': 'Not a video link VeroXM can play.',
126
+ 'chart.kind': 'Kind',
127
+ 'chart.kind.bar': 'Columns',
128
+ 'chart.kind.hbar': 'Bars',
129
+ 'chart.kind.line': 'Line',
130
+ 'chart.kind.area': 'Area',
131
+ 'chart.kind.pie': 'Pie',
132
+ 'chart.kind.donut': 'Donut',
133
+ 'chart.kind.kpi': 'Key figure',
134
+ 'chart.sample': 'These are the template’s sample numbers. Put in your own before publishing.',
135
+ 'chart.numbers': 'Numbers: paste from a spreadsheet, or type a row per label',
136
+ 'chart.firstRow': 'First row: Label, then a name for each series.',
137
+ 'chart.fromAnalytics': 'The numbers come from VeroXM analytics and fill in when the page loads. Change where they come from in the dashboard.',
138
+ 'chart.fromContent': 'The numbers come from the “{collection}” collection and fill in when the page loads. Change where they come from in the dashboard.',
139
+ 'chart.fromApi': 'The numbers come from your API and fill in when the page loads. Change where they come from in the dashboard.',
140
+ 'chart.prefix': 'Before numbers, such as $',
141
+ 'chart.prefixPlaceholder': 'Before (SAR )',
142
+ 'chart.suffix': 'After numbers, such as %',
143
+ 'chart.suffixPlaceholder': 'After ( SAR, %)',
144
+ 'chart.caption': 'Caption',
145
+ 'map.count': { by: 'max', one: '{n} of {max} place', other: '{n} of {max} places' },
146
+ 'map.placeN': 'place {n}',
147
+ 'map.find': 'Find on map',
148
+ 'map.finding': 'Finding…',
149
+ 'map.matches': 'Places matching {q}',
150
+ 'map.attribution': 'Search by OpenStreetMap Nominatim',
151
+ 'map.position': 'Position: coordinates or a map link',
152
+ 'map.placed': 'On the map.',
153
+ 'map.notPlaced': 'Not placed yet: find the address, or paste coordinates or a link from a map site.',
154
+ 'map.nothingFound': 'Nothing found. Try a fuller address, or paste a map link.',
155
+ 'map.searchFailed': 'Address search failed.',
156
+ 'map.add': 'Add place',
157
+ 'slides.count': { by: 'max', one: '{n} of {max} slide', other: '{n} of {max} slides' },
158
+ 'slides.slideN': 'slide {n}',
159
+ 'slides.image': 'Slide {n} image',
160
+ 'slides.buttonText': 'Button text',
161
+ 'slides.buttonTextOf': 'Button text of {title}',
162
+ 'slides.buttonLinkOf': 'Button link of {title}',
163
+ 'slides.add': 'Add slide',
164
+ 'list.count': { by: 'max', one: '{n} of {max} item', other: '{n} of {max} items' },
165
+ 'list.itemN': 'Item {n}',
166
+ 'list.showsFrom': 'Shows from',
167
+ 'list.until': 'Until',
168
+ 'list.add': 'Add item',
169
+ 'media.fromCode': 'Shown from the site’s code. It isn’t in the media library, so it can’t be saved with the slot.',
170
+ 'media.fromCodeImport': 'Shown from the site’s code. It isn’t in the media library, so it can’t be saved with the slot until you import it.',
171
+ 'media.import': 'Import into Media',
172
+ 'media.importing': 'Importing…',
173
+ 'media.notImage': 'That address didn’t return an image.',
174
+ 'media.importFailed': 'Could not import the image.',
175
+ 'media.none': 'No image chosen.',
176
+ 'media.choose': 'Choose image',
177
+ 'media.replace': 'Replace image',
178
+ 'media.closeLibrary': 'Close library',
179
+ 'media.search': 'Search the media library',
180
+ 'media.noneFound': 'No images found.',
181
+ 'media.loadFailed': 'Could not load images.',
182
+ // menu field
183
+ 'menu.itemN': 'item {n}',
184
+ 'menu.label': 'Label',
185
+ 'menu.labelOf': 'Label of {title}',
186
+ 'menu.linkOptional': 'Link (optional)',
187
+ 'menu.linkOf': 'Link of {title}',
188
+ 'menu.iconOf': 'Icon of {title}',
189
+ 'menu.noIcon': 'No icon',
190
+ 'menu.badge': 'Badge (optional)',
191
+ 'menu.badgeOf': 'Badge of {title}',
192
+ 'menu.description': 'Description (optional)',
193
+ 'menu.descriptionOf': 'Description of {title}',
194
+ 'menu.newTab': 'New tab',
195
+ 'menu.up': 'Move {title} up',
196
+ 'menu.down': 'Move {title} down',
197
+ 'menu.outdent': 'Move {title} out a level',
198
+ 'menu.indent': 'Move {title} under the item above',
199
+ 'menu.addSub': 'Add a sub-item under {title}',
200
+ 'menu.sub': '+ Sub',
201
+ 'menu.removeWithSubs': 'Remove {title} and its sub-items',
202
+ 'menu.oneLevel': 'one level',
203
+ 'menu.levels': 'up to {n} levels',
204
+ 'menu.empty': 'No items yet: the site shows its own menu.',
205
+ // rich text
206
+ 'rte.toolbar': 'Formatting',
207
+ 'rte.bold': 'Bold (Ctrl+B)',
208
+ 'rte.italic': 'Italic (Ctrl+I)',
209
+ 'rte.heading': 'Heading',
210
+ 'rte.subheading': 'Subheading',
211
+ 'rte.bullets': 'Bulleted list',
212
+ 'rte.bulletsShort': '• List',
213
+ 'rte.numbered': 'Numbered list',
214
+ 'rte.numberedShort': '1. List',
215
+ 'rte.link': 'Link (Ctrl+K)',
216
+ 'rte.linkShort': 'Link',
217
+ 'rte.clear': 'Clear formatting',
218
+ 'rte.clearShort': 'Clear',
219
+ 'rte.linkAddress': 'Link address (leave empty to remove)',
220
+ 'rte.apply': 'Apply',
221
+ 'rte.badLink': 'Use https://, http://, mailto:, tel:, / or #',
222
+ 'rte.count': '{n} / {max} characters, including formatting',
223
+ };
224
+ const ar = {
225
+ 'bar.aria': 'محرر VeroXM',
226
+ 'bar.editing': 'تحرير المسودات',
227
+ 'bar.ended': 'انتهى التحرير',
228
+ 'bar.clickOn': 'النقر للتحرير: مفعّل',
229
+ 'bar.clickOff': 'النقر للتحرير: متوقف',
230
+ 'bar.slots': 'الأقسام في هذه الصفحة',
231
+ 'bar.exit': 'خروج',
232
+ 'bar.language': 'لغة الواجهة',
233
+ 'bar.digits': 'الأرقام',
234
+ 'bar.digitsLatn': 'أرقام لاتينية (0123)',
235
+ 'bar.digitsArab': 'أرقام هندية (٠١٢٣)',
236
+ 'list.empty': 'لا توجد أقسام ظاهرة في هذه الصفحة.',
237
+ 'inline.keys': 'Enter للحفظ · Esc للإلغاء',
238
+ 'inline.aria': '{label} (قيد التحرير – Enter للحفظ، Escape للإلغاء)',
239
+ 'error.unreachable': 'تعذّر الوصول إلى VeroXM.',
240
+ 'error.http': 'حدث خطأ (HTTP {status}).',
241
+ 'error.save': 'تعذّر الحفظ. تحقّق من اتصالك.',
242
+ 'error.generic': 'حدث خطأ. حاول مرة أخرى.',
243
+ 'error.discard': 'تعذّر تجاهل التغييرات.',
244
+ 'error.unknownSlot': 'لا يعرف VeroXM هذا القسم بعد. أعد تحميل الصفحة ليُبلغ الموقع عنه، ثم حاول مرة أخرى.',
245
+ 'panel.close': 'إغلاق',
246
+ 'panel.live': 'الإصدار {version} منشور',
247
+ 'panel.neverPublished': 'لم يُنشر بعد',
248
+ 'panel.loading': 'جارٍ التحميل…',
249
+ 'panel.inherited': 'لم يُحفظ شيء بلغة {locale} بعد؛ تبدأ من النسخة المنشورة باللغة الافتراضية.',
250
+ 'seed.filled': 'تمت التعبئة من محتوى الصفحة الحالي ({fields}). غيّر ما تحتاج ثم انشر.',
251
+ 'seed.inheritedSplit': 'لم يُحفظ شيء بلغة {locale} بعد. من محتوى هذه الصفحة بلغة {locale}: {fields}. من النسخة المنشورة باللغة الافتراضية: {rest}.',
252
+ 'seed.inheritedAll': 'لم يُحفظ شيء بلغة {locale} بعد. تمت التعبئة من محتوى هذه الصفحة بلغة {locale} ({fields}). غيّر ما تحتاج ثم انشر.',
253
+ 'fill.offer': 'فارغ هنا، لكن الصفحة تعرض محتوى في: {fields}.',
254
+ 'fill.button': 'تعبئة الحقول الفارغة من الصفحة',
255
+ 'fill.done': 'تمت تعبئة {fields} من الصفحة. غيّر ما تحتاج ثم انشر.',
256
+ 'list.separator': '، ',
257
+ 'status.savingVariant': 'جارٍ حفظ البديل…',
258
+ 'status.savingDraft': 'جارٍ حفظ المسودة…',
259
+ 'status.variantSaved': 'تم حفظ البديل',
260
+ 'status.draftSaved': 'تم حفظ المسودة',
261
+ 'status.editing': 'جارٍ التحرير… يُحفظ خلال لحظات',
262
+ 'status.unpublished': 'تغييرات غير منشورة',
263
+ 'status.clean': 'لا توجد تغييرات غير منشورة',
264
+ 'notice.discarded': 'تم تجاهل التغييرات.',
265
+ 'outcome.published': 'تم النشر. يراه الزوار الآن.',
266
+ 'outcome.submitted': 'أُرسل للموافقة. لن يتغير شيء للزوار حتى تتم الموافقة.',
267
+ 'outcome.approved': 'تمت الموافقة. ينتقل إلى الخطوة التالية.',
268
+ 'outcome.rejected': 'مرفوض. يمكن لكاتبه تعديله وإرساله مرة أخرى.',
269
+ 'outcome.withdrawn': 'سُحب الطلب. مسودتك كما هي.',
270
+ 'publish.button': 'نشر',
271
+ 'publish.busy': 'جارٍ النشر…',
272
+ 'publish.send': 'إرسال للموافقة',
273
+ 'publish.sending': 'جارٍ الإرسال…',
274
+ 'publish.noPermission': 'يمكن لمن لديه صلاحية النشر نشرُ هذا.',
275
+ 'discard.button': 'تجاهل التغييرات',
276
+ 'discard.confirm': 'تجاهل كل التغييرات؟',
277
+ 'discard.busy': 'جارٍ التجاهل…',
278
+ 'approval.aria': 'الموافقة',
279
+ 'approval.waiting': 'بانتظار الموافقة',
280
+ 'approval.step': 'الخطوة {n} من {total}',
281
+ 'approval.sentBy': 'أرسله {name}',
282
+ 'approval.changed': 'التعديلات التي أُجريت بعد الإرسال ليست جزءًا من الطلب.',
283
+ 'approval.comment': 'تعليق (مطلوب للرفض)',
284
+ 'approval.approve': 'اعتماد',
285
+ 'approval.approvePublish': 'اعتماد ونشر',
286
+ 'approval.approving': 'جارٍ الاعتماد…',
287
+ 'approval.reject': 'رفض',
288
+ 'approval.rejecting': 'جارٍ الرفض…',
289
+ 'approval.other': 'يعتمده شخص آخر من دور هذه الخطوة.',
290
+ 'approval.withdraw': 'سحب الطلب',
291
+ 'approval.withdrawing': 'جارٍ السحب…',
292
+ 'test.draft': 'مسودة اختبار',
293
+ 'test.pending_approval': 'اختبار بانتظار الموافقة',
294
+ 'test.live': 'اختبار قيد التشغيل',
295
+ 'test.paused': 'اختبار متوقف مؤقتًا',
296
+ 'test.generic': 'اختبار',
297
+ 'test.versions': 'النسخة المعروضة للتحرير',
298
+ 'test.published': 'المنشور',
299
+ 'test.editable': 'تعرض الصفحة هذا البديل. التعديلات تغيّر هذا البديل فقط، والحقول الفارغة تستخدم النسخة المنشورة.',
300
+ 'test.noPermission': 'تعرض الصفحة هذا البديل. تحرير البدائل يتطلب صلاحية إدارة التجارب.',
301
+ 'test.locked': 'تعرض الصفحة هذا البديل. لا يمكن تغيير البدائل بعد بدء الاختبار.',
302
+ 'test.settings': 'إعدادات الاختبار ونتائجه',
303
+ 'test.back': 'العودة إلى المنشور',
304
+ 'text.count': '{n} / {max}',
305
+ 'common.remove': 'حذف',
306
+ 'common.removeItem': 'حذف {title}',
307
+ 'common.moveEarlier': 'تقديم {title}',
308
+ 'common.moveLater': 'تأخير {title}',
309
+ 'common.title': 'العنوان',
310
+ 'common.text': 'النص',
311
+ 'common.address': 'العنوان',
312
+ 'common.name': 'الاسم',
313
+ 'common.pagePlaceholder': 'https://… أو /page',
314
+ 'common.pagePlaceholderShort': '/page أو https://…',
315
+ 'link.text': 'النص',
316
+ 'link.address': 'الرابط',
317
+ 'component.label': 'المكوّن',
318
+ 'component.choose': 'اختر مكوّنًا',
319
+ 'component.none': 'لا شيء (الافتراضي في الموقع)',
320
+ 'video.url': 'رابط YouTube أو Vimeo، أو ملف فيديو',
321
+ 'video.empty': 'تعرضه الصفحة في مشغّل فيديو.',
322
+ 'video.recognised': '{provider}: تم التعرّف عليه.',
323
+ 'video.file': 'ملف فيديو',
324
+ 'video.bad': 'ليس رابط فيديو يستطيع VeroXM تشغيله.',
325
+ 'chart.kind': 'النوع',
326
+ 'chart.kind.bar': 'أعمدة',
327
+ 'chart.kind.hbar': 'أشرطة',
328
+ 'chart.kind.line': 'خطي',
329
+ 'chart.kind.area': 'مساحي',
330
+ 'chart.kind.pie': 'دائري',
331
+ 'chart.kind.donut': 'حلقي',
332
+ 'chart.kind.kpi': 'رقم رئيسي',
333
+ 'chart.sample': 'هذه أرقام القالب التجريبية. ضع أرقامك قبل النشر.',
334
+ 'chart.numbers': 'الأرقام: الصقها من جدول بيانات، أو اكتب صفًا لكل تسمية',
335
+ 'chart.firstRow': 'الصف الأول: Label، ثم اسم لكل سلسلة.',
336
+ 'chart.fromAnalytics': 'تأتي الأرقام من تحليلات VeroXM وتُملأ عند تحميل الصفحة. غيّر مصدرها من لوحة التحكم.',
337
+ 'chart.fromContent': 'تأتي الأرقام من مجموعة «{collection}» وتُملأ عند تحميل الصفحة. غيّر مصدرها من لوحة التحكم.',
338
+ 'chart.fromApi': 'تأتي الأرقام من واجهتك البرمجية (API) وتُملأ عند تحميل الصفحة. غيّر مصدرها من لوحة التحكم.',
339
+ 'chart.prefix': 'قبل الأرقام، مثل $',
340
+ 'chart.prefixPlaceholder': 'قبل (ر.س )',
341
+ 'chart.suffix': 'بعد الأرقام، مثل %',
342
+ 'chart.suffixPlaceholder': 'بعد ( ر.س، %)',
343
+ 'chart.caption': 'التعليق',
344
+ 'map.count': { by: 'max', zero: '{n} من {max} موقع', one: '{n} من موقع واحد', two: '{n} من موقعين', few: '{n} من {max} مواقع', many: '{n} من {max} موقعًا', other: '{n} من {max} موقع' },
345
+ 'map.placeN': 'الموقع {n}',
346
+ 'map.find': 'البحث على الخريطة',
347
+ 'map.finding': 'جارٍ البحث…',
348
+ 'map.matches': 'أماكن تطابق {q}',
349
+ 'map.attribution': 'البحث بواسطة OpenStreetMap Nominatim',
350
+ 'map.position': 'الموضع: إحداثيات أو رابط خريطة',
351
+ 'map.placed': 'على الخريطة.',
352
+ 'map.notPlaced': 'لم يُحدَّد بعد: ابحث عن العنوان، أو الصق إحداثيات أو رابطًا من موقع خرائط.',
353
+ 'map.nothingFound': 'لم يُعثر على شيء. جرّب عنوانًا أكمل، أو الصق رابط خريطة.',
354
+ 'map.searchFailed': 'فشل البحث عن العنوان.',
355
+ 'map.add': 'إضافة موقع',
356
+ 'slides.count': { by: 'max', zero: '{n} من {max} شريحة', one: '{n} من شريحة واحدة', two: '{n} من شريحتين', few: '{n} من {max} شرائح', many: '{n} من {max} شريحة', other: '{n} من {max} شريحة' },
357
+ 'slides.slideN': 'الشريحة {n}',
358
+ 'slides.image': 'صورة الشريحة {n}',
359
+ 'slides.buttonText': 'نص الزر',
360
+ 'slides.buttonTextOf': 'نص زر {title}',
361
+ 'slides.buttonLinkOf': 'رابط زر {title}',
362
+ 'slides.add': 'إضافة شريحة',
363
+ 'list.count': { by: 'max', zero: '{n} من {max} عنصر', one: '{n} من عنصر واحد', two: '{n} من عنصرين', few: '{n} من {max} عناصر', many: '{n} من {max} عنصرًا', other: '{n} من {max} عنصر' },
364
+ 'list.itemN': 'العنصر {n}',
365
+ 'list.showsFrom': 'يظهر من',
366
+ 'list.until': 'حتى',
367
+ 'list.add': 'إضافة عنصر',
368
+ 'media.fromCode': 'معروضة من شيفرة الموقع. ليست في مكتبة الوسائط، لذا لا يمكن حفظها مع القسم.',
369
+ 'media.fromCodeImport': 'معروضة من شيفرة الموقع. ليست في مكتبة الوسائط، لذا لا يمكن حفظها مع القسم حتى تستوردها.',
370
+ 'media.import': 'استيراد إلى الوسائط',
371
+ 'media.importing': 'جارٍ الاستيراد…',
372
+ 'media.notImage': 'لم يُرجع هذا العنوان صورة.',
373
+ 'media.importFailed': 'تعذّر استيراد الصورة.',
374
+ 'media.none': 'لم تُختر صورة.',
375
+ 'media.choose': 'اختيار صورة',
376
+ 'media.replace': 'استبدال الصورة',
377
+ 'media.closeLibrary': 'إغلاق المكتبة',
378
+ 'media.search': 'البحث في مكتبة الوسائط',
379
+ 'media.noneFound': 'لم يُعثر على صور.',
380
+ 'media.loadFailed': 'تعذّر تحميل الصور.',
381
+ 'menu.itemN': 'العنصر {n}',
382
+ 'menu.label': 'التسمية',
383
+ 'menu.labelOf': 'تسمية {title}',
384
+ 'menu.linkOptional': 'الرابط (اختياري)',
385
+ 'menu.linkOf': 'رابط {title}',
386
+ 'menu.iconOf': 'أيقونة {title}',
387
+ 'menu.noIcon': 'بلا أيقونة',
388
+ 'menu.badge': 'شارة (اختياري)',
389
+ 'menu.badgeOf': 'شارة {title}',
390
+ 'menu.description': 'الوصف (اختياري)',
391
+ 'menu.descriptionOf': 'وصف {title}',
392
+ 'menu.newTab': 'تبويب جديد',
393
+ 'menu.up': 'نقل {title} للأعلى',
394
+ 'menu.down': 'نقل {title} للأسفل',
395
+ 'menu.outdent': 'نقل {title} مستوى للخارج',
396
+ 'menu.indent': 'نقل {title} تحت العنصر السابق',
397
+ 'menu.addSub': 'إضافة عنصر فرعي تحت {title}',
398
+ 'menu.sub': '+ فرعي',
399
+ 'menu.removeWithSubs': 'حذف {title} وعناصره الفرعية',
400
+ 'menu.oneLevel': 'مستوى واحد',
401
+ 'menu.levels': { two: 'حتى مستويين', few: 'حتى {n} مستويات', other: 'حتى {n} مستوى' },
402
+ 'menu.empty': 'لا عناصر بعد: يعرض الموقع قائمته الخاصة.',
403
+ 'rte.toolbar': 'التنسيق',
404
+ 'rte.bold': 'غامق (Ctrl+B)',
405
+ 'rte.italic': 'مائل (Ctrl+I)',
406
+ 'rte.heading': 'عنوان',
407
+ 'rte.subheading': 'عنوان فرعي',
408
+ 'rte.bullets': 'قائمة نقطية',
409
+ 'rte.bulletsShort': '• قائمة',
410
+ 'rte.numbered': 'قائمة مرقّمة',
411
+ 'rte.numberedShort': '1. قائمة',
412
+ 'rte.link': 'رابط (Ctrl+K)',
413
+ 'rte.linkShort': 'رابط',
414
+ 'rte.clear': 'إزالة التنسيق',
415
+ 'rte.clearShort': 'مسح',
416
+ 'rte.linkAddress': 'عنوان الرابط (اتركه فارغًا لإزالة الرابط)',
417
+ 'rte.apply': 'تطبيق',
418
+ 'rte.badLink': 'استخدم https:// أو http:// أو mailto: أو tel: أو / أو #',
419
+ 'rte.count': 'الأحرف: {n} من {max}، مع التنسيق',
420
+ };
421
+ export const EDITOR_MESSAGES = { en, ar };
422
+ const numberFormats = new Map();
423
+ const pluralRules = new Map();
424
+ function numberFormat(lang, digits) {
425
+ const key = `${lang}|${digits}`;
426
+ let f = numberFormats.get(key);
427
+ if (!f) {
428
+ f = new Intl.NumberFormat(lang === 'ar' ? `ar-u-nu-${digits}` : 'en-u-nu-latn', { useGrouping: false, maximumFractionDigits: 6 });
429
+ numberFormats.set(key, f);
430
+ }
431
+ return f;
432
+ }
433
+ function pluralRule(lang) {
434
+ let r = pluralRules.get(lang);
435
+ if (!r) {
436
+ r = new Intl.PluralRules(lang);
437
+ pluralRules.set(lang, r);
438
+ }
439
+ return r;
440
+ }
441
+ export function createTranslator(lang, options = {}) {
442
+ // Latin digits are the default in the Arabic interface too (usual in Saudi digital products); English always uses them.
443
+ const digits = lang === 'ar' ? (options.digits ?? 'latn') : 'latn';
444
+ const fmt = numberFormat(lang, digits);
445
+ const num = (n) => fmt.format(n);
446
+ const t = (key, vars = {}) => {
447
+ const msg = EDITOR_MESSAGES[lang][key] ?? en[key];
448
+ if (msg === undefined)
449
+ return key;
450
+ let text;
451
+ if (typeof msg === 'string')
452
+ text = msg;
453
+ else {
454
+ const n = Number(vars[msg.by ?? 'n'] ?? 0);
455
+ const cat = pluralRule(lang).select(n);
456
+ text = msg[cat] ?? msg.other;
457
+ }
458
+ return text.replace(/\{(\w+)\}/g, (whole, name) => {
459
+ const v = vars[name];
460
+ if (v === undefined || v === null)
461
+ return whole;
462
+ return typeof v === 'number' ? num(v) : v;
463
+ });
464
+ };
465
+ const list = (items) => items.join(t('list.separator'));
466
+ return { lang, dir: lang === 'ar' ? 'rtl' : 'ltr', digits, t, num, list };
467
+ }
468
+ /** 'ar', 'ar-SA', 'AR' -> 'ar'; anything the editor isn't written in -> null. */
469
+ export function editorLang(value) {
470
+ const base = (value ?? '').trim().toLowerCase().split(/[-_]/)[0];
471
+ return EDITOR_LANGS.includes(base ?? '') ? base : null;
472
+ }
473
+ /**
474
+ * The label to show in `lang`: that language's, else English, else the first one given. A plain string is the
475
+ * same in every language. `labels` (what VeroXM stored from the site) wins over `label` (its one-text form).
476
+ */
477
+ export function pickLabel(lang, label, labels) {
478
+ const map = labels && typeof labels === 'object' ? labels : label && typeof label === 'object' ? label : null;
479
+ if (map) {
480
+ const base = lang.toLowerCase().split(/[-_]/)[0] ?? '';
481
+ const exact = map[lang] ?? map[base];
482
+ if (typeof exact === 'string' && exact.trim())
483
+ return exact;
484
+ if (typeof map.en === 'string' && map.en.trim())
485
+ return map.en;
486
+ const first = Object.values(map).find((v) => typeof v === 'string' && v.trim() !== '');
487
+ if (first)
488
+ return first;
489
+ }
490
+ return typeof label === 'string' && label.trim() ? label : undefined;
491
+ }
@@ -3,6 +3,8 @@ export interface InlineEditOptions {
3
3
  max?: number;
4
4
  /** Accessible name while editing, e.g. "Headline". */
5
5
  label: string;
6
+ /** The whole accessible name while editing, in the editor's language (default: "<label> (editing – Enter to save, Escape to cancel)"). */
7
+ ariaLabel?: string;
6
8
  /** Text to start from when the element shows none (nothing stored: the page's fallback). */
7
9
  initialText?: string;
8
10
  /** Where the click landed, to put the caret there. */
@@ -46,7 +46,7 @@ export function startInlineEdit(el, opts) {
46
46
  if (!plainOnly)
47
47
  el.setAttribute('contenteditable', 'true');
48
48
  el.setAttribute('role', 'textbox');
49
- el.setAttribute('aria-label', `${opts.label} (editing – Enter to save, Escape to cancel)`);
49
+ el.setAttribute('aria-label', opts.ariaLabel ?? `${opts.label} (editing – Enter to save, Escape to cancel)`);
50
50
  el.setAttribute('spellcheck', 'true');
51
51
  el.setAttribute('data-veroxm-inline', '');
52
52
  el.focus({ preventScroll: true });
@@ -24,5 +24,5 @@ export declare function MenuInput({ name, label, required, depth, icons, value,
24
24
  onChange(v: SlotMenuItem[] | null): void;
25
25
  onFocus(): void;
26
26
  }): import("react").JSX.Element;
27
- export declare const MENU_STYLES = "\n.vx-menu-list{list-style:none;margin:4px 0 0;padding:0;display:flex;flex-direction:column;gap:6px}\n.vx-menu-sub{margin-left:10px;padding-left:10px;border-left:2px solid #e4e4e7}\n.vx-menu-item{display:flex;flex-direction:column;gap:4px}\n.vx-menu-row{display:grid;grid-template-columns:1fr 1fr;gap:4px}\n.vx-menu-row input{width:100%;padding:6px 8px;border:1px solid #d4d4d8;border-radius:8px;background:#fff;min-width:0}\n.vx-menu-tools{display:flex;flex-wrap:wrap;gap:4px;align-items:center}\n.vx-menu-tab{display:flex;align-items:center;gap:4px;font-size:12px;color:#52525b;margin-right:auto}\n.vx-slide-card{border:1px solid #e4e4e7;border-radius:10px;padding:8px;display:flex;flex-direction:column;gap:4px;margin:4px 0 6px}\n.vx-slide-card .vx-field{margin:0}\n.vx-result{appearance:none;display:block;width:100%;text-align:left;border:0;background:transparent;padding:6px;border-radius:6px;cursor:pointer;font-size:13px}\n.vx-result:hover{background:#f4f4f5}\n.vx-mini{appearance:none;cursor:pointer;border:1px solid #e4e4e7;background:#fff;border-radius:6px;min-width:26px;height:24px;padding:0 6px;font-size:12px}\n.vx-mini:disabled{opacity:.4;cursor:not-allowed}\n@media (prefers-color-scheme: dark){\n.vx-menu-sub,.vx-slide-card{border-color:#3f3f46}\n.vx-menu-row input{background:#09090b;border-color:#3f3f46}\n.vx-menu-tab{color:#a1a1aa}\n.vx-mini{background:#27272a;border-color:#3f3f46}\n}\n";
27
+ export declare const MENU_STYLES = "\n.vx-menu-list{list-style:none;margin:4px 0 0;padding:0;display:flex;flex-direction:column;gap:6px}\n.vx-menu-sub{margin-inline-start:10px;padding-inline-start:10px;border-inline-start:2px solid #e4e4e7}\n.vx-menu-item{display:flex;flex-direction:column;gap:4px}\n.vx-menu-row{display:grid;grid-template-columns:1fr 1fr;gap:4px}\n.vx-menu-row input{width:100%;padding:6px 8px;border:1px solid #d4d4d8;border-radius:8px;background:#fff;min-width:0}\n.vx-menu-tools{display:flex;flex-wrap:wrap;gap:4px;align-items:center}\n.vx-menu-tab{display:flex;align-items:center;gap:4px;font-size:12px;color:#52525b;margin-inline-end:auto}\n.vx-slide-card{border:1px solid #e4e4e7;border-radius:10px;padding:8px;display:flex;flex-direction:column;gap:4px;margin:4px 0 6px}\n.vx-slide-card .vx-field{margin:0}\n.vx-result{appearance:none;display:block;width:100%;text-align:start;border:0;background:transparent;padding:6px;border-radius:6px;cursor:pointer;font-size:13px}\n.vx-result:hover{background:#f4f4f5}\n.vx-mini{appearance:none;cursor:pointer;border:1px solid #e4e4e7;background:#fff;border-radius:6px;min-width:26px;height:24px;padding:0 6px;font-size:12px}\n.vx-mini:disabled{opacity:.4;cursor:not-allowed}\n@media (prefers-color-scheme: dark){\n.vx-menu-sub,.vx-slide-card{border-color:#3f3f46}\n.vx-menu-row input{background:#09090b;border-color:#3f3f46}\n.vx-menu-tab{color:#a1a1aa}\n.vx-mini{background:#27272a;border-color:#3f3f46}\n}\n";
28
28
  export {};
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useId } from 'react';
3
+ import { useUi } from './ui-context.js';
3
4
  // A menu field in the on-page editor: the same tree as the dashboard's,
4
5
  // compact enough for the side panel. Each item has a label, a link and
5
6
  // "new tab"; items move up and down, in under the item above, and out a
@@ -76,6 +77,7 @@ export const menuOps = {
76
77
  },
77
78
  };
78
79
  export function MenuInput({ name, label, required, depth, icons, value, onChange, onFocus, }) {
80
+ const ui = useUi();
79
81
  const id = useId();
80
82
  const items = Array.isArray(value) ? value : [];
81
83
  const total = countItems(items);
@@ -83,23 +85,23 @@ export function MenuInput({ name, label, required, depth, icons, value, onChange
83
85
  const rows = (list, parent) => list.map((item, i) => {
84
86
  const path = [...parent, i];
85
87
  const level = path.length;
86
- const title = item.label.trim() || `item ${i + 1}`;
88
+ const title = item.label.trim() || ui.t('menu.itemN', { n: i + 1 });
87
89
  const canIndent = i > 0 && level + depthOf(item) <= depth;
88
- return (_jsxs("li", { className: "vx-menu-item", children: [_jsxs("div", { className: "vx-menu-row", children: [_jsx("input", { type: "text", "data-field": level === 1 && i === 0 ? name : undefined, onFocus: onFocus, value: item.label, maxLength: 80, placeholder: "Label", "aria-label": `Label of ${title}`, onChange: (e) => set(menuOps.update(items, path, { label: e.target.value })) }), _jsx("input", { type: "text", inputMode: "url", onFocus: onFocus, value: item.href, placeholder: item.children?.length ? 'Link (optional)' : '/page or https://…', "aria-label": `Link of ${title}`, onChange: (e) => set(menuOps.update(items, path, { href: e.target.value })) })] }), _jsxs("div", { className: "vx-menu-row", children: [icons?.length ? (_jsxs("select", { "aria-label": `Icon of ${title}`, onFocus: onFocus, value: item.icon ?? '', onChange: (e) => set(menuOps.update(items, path, { icon: e.target.value || undefined })), children: [_jsx("option", { value: "", children: "No icon" }), icons.map((icon) => (_jsx("option", { value: icon, children: icon }, icon)))] })) : null, _jsx("input", { type: "text", onFocus: onFocus, value: item.badge ?? '', maxLength: 24, placeholder: "Badge (optional)", "aria-label": `Badge of ${title}`, onChange: (e) => set(menuOps.update(items, path, { badge: e.target.value || undefined })) }), _jsx("input", { type: "text", onFocus: onFocus, value: item.description ?? '', maxLength: 160, placeholder: "Description (optional)", "aria-label": `Description of ${title}`, onChange: (e) => set(menuOps.update(items, path, { description: e.target.value || undefined })) })] }), _jsxs("div", { className: "vx-menu-tools", children: [_jsxs("label", { className: "vx-menu-tab", children: [_jsx("input", { type: "checkbox", checked: !!item.newTab, onChange: (e) => set(menuOps.update(items, path, { newTab: e.target.checked || undefined })) }), "New tab"] }), _jsx("button", { type: "button", className: "vx-mini", disabled: i === 0, "aria-label": `Move ${title} up`, onClick: () => set(menuOps.move(items, path, -1)), children: "\u2191" }), _jsx("button", { type: "button", className: "vx-mini", disabled: i === list.length - 1, "aria-label": `Move ${title} down`, onClick: () => set(menuOps.move(items, path, 1)), children: "\u2193" }), depth > 1 ? (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", className: "vx-mini", disabled: level === 1, "aria-label": `Move ${title} out a level`, onClick: () => set(menuOps.outdent(items, path)), children: "\u2190" }), _jsx("button", { type: "button", className: "vx-mini", disabled: !canIndent, "aria-label": `Move ${title} under the item above`, onClick: () => set(menuOps.indent(items, path)), children: "\u2192" })] })) : null, level < depth ? (_jsx("button", { type: "button", className: "vx-mini", disabled: total >= MAX_MENU_ITEMS, "aria-label": `Add a sub-item under ${title}`, onClick: () => set(menuOps.add(items, path)), children: "+ Sub" })) : null, _jsx("button", { type: "button", className: "vx-mini", "aria-label": `Remove ${title}${item.children?.length ? ' and its sub-items' : ''}`, onClick: () => set(menuOps.remove(items, path)), children: "Remove" })] }), item.children?.length ? _jsx("ul", { className: "vx-menu-list vx-menu-sub", children: rows(item.children, path) }) : null] }, path.join('-')));
90
+ return (_jsxs("li", { className: "vx-menu-item", children: [_jsxs("div", { className: "vx-menu-row", children: [_jsx("input", { type: "text", dir: "auto", "data-field": level === 1 && i === 0 ? name : undefined, onFocus: onFocus, value: item.label, maxLength: 80, placeholder: ui.t('menu.label'), "aria-label": ui.t('menu.labelOf', { title }), onChange: (e) => set(menuOps.update(items, path, { label: e.target.value })) }), _jsx("input", { type: "text", dir: "auto", inputMode: "url", onFocus: onFocus, value: item.href, placeholder: item.children?.length ? ui.t('menu.linkOptional') : ui.t('common.pagePlaceholderShort'), "aria-label": ui.t('menu.linkOf', { title }), onChange: (e) => set(menuOps.update(items, path, { href: e.target.value })) })] }), _jsxs("div", { className: "vx-menu-row", children: [icons?.length ? (_jsxs("select", { "aria-label": ui.t('menu.iconOf', { title }), onFocus: onFocus, value: item.icon ?? '', onChange: (e) => set(menuOps.update(items, path, { icon: e.target.value || undefined })), children: [_jsx("option", { value: "", children: ui.t('menu.noIcon') }), icons.map((icon) => (_jsx("option", { value: icon, children: icon }, icon)))] })) : null, _jsx("input", { type: "text", dir: "auto", onFocus: onFocus, value: item.badge ?? '', maxLength: 24, placeholder: ui.t('menu.badge'), "aria-label": ui.t('menu.badgeOf', { title }), onChange: (e) => set(menuOps.update(items, path, { badge: e.target.value || undefined })) }), _jsx("input", { type: "text", dir: "auto", onFocus: onFocus, value: item.description ?? '', maxLength: 160, placeholder: ui.t('menu.description'), "aria-label": ui.t('menu.descriptionOf', { title }), onChange: (e) => set(menuOps.update(items, path, { description: e.target.value || undefined })) })] }), _jsxs("div", { className: "vx-menu-tools", children: [_jsxs("label", { className: "vx-menu-tab", children: [_jsx("input", { type: "checkbox", checked: !!item.newTab, onChange: (e) => set(menuOps.update(items, path, { newTab: e.target.checked || undefined })) }), ui.t('menu.newTab')] }), _jsx("button", { type: "button", className: "vx-mini", disabled: i === 0, "aria-label": ui.t('menu.up', { title }), onClick: () => set(menuOps.move(items, path, -1)), children: "\u2191" }), _jsx("button", { type: "button", className: "vx-mini", disabled: i === list.length - 1, "aria-label": ui.t('menu.down', { title }), onClick: () => set(menuOps.move(items, path, 1)), children: "\u2193" }), depth > 1 ? (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", className: "vx-mini", disabled: level === 1, "aria-label": ui.t('menu.outdent', { title }), onClick: () => set(menuOps.outdent(items, path)), children: ui.dir === 'rtl' ? '→' : '←' }), _jsx("button", { type: "button", className: "vx-mini", disabled: !canIndent, "aria-label": ui.t('menu.indent', { title }), onClick: () => set(menuOps.indent(items, path)), children: ui.dir === 'rtl' ? '←' : '→' })] })) : null, level < depth ? (_jsx("button", { type: "button", className: "vx-mini", disabled: total >= MAX_MENU_ITEMS, "aria-label": ui.t('menu.addSub', { title }), onClick: () => set(menuOps.add(items, path)), children: ui.t('menu.sub') })) : null, _jsx("button", { type: "button", className: "vx-mini", "aria-label": item.children?.length ? ui.t('menu.removeWithSubs', { title }) : ui.t('common.removeItem', { title }), onClick: () => set(menuOps.remove(items, path)), children: ui.t('common.remove') })] }), item.children?.length ? _jsx("ul", { className: "vx-menu-list vx-menu-sub", children: rows(item.children, path) }) : null] }, path.join('-')));
89
91
  });
90
- return (_jsxs("fieldset", { className: "vx-field vx-fieldset", "aria-describedby": `${id}-count`, children: [_jsxs("legend", { className: "vx-label", children: [label, required ? _jsx("span", { "aria-hidden": "true", children: " *" }) : null] }), _jsxs("span", { id: `${id}-count`, className: "vx-count", children: [total, " / ", MAX_MENU_ITEMS, " items \u00B7 ", depth === 1 ? 'one level' : `up to ${depth} levels`] }), items.length ? _jsx("ul", { className: "vx-menu-list", children: rows(items, []) }) : _jsx("p", { className: "vx-muted", children: "No items yet: the site shows its own menu." }), _jsx("div", { className: "vx-actions", children: _jsx("button", { type: "button", className: "vx-btn", "data-field": items.length ? undefined : name, onFocus: onFocus, disabled: total >= MAX_MENU_ITEMS, onClick: () => set(menuOps.add(items, [])), children: "Add item" }) })] }));
92
+ return (_jsxs("fieldset", { className: "vx-field vx-fieldset", "aria-describedby": `${id}-count`, children: [_jsxs("legend", { className: "vx-label", children: [label, required ? _jsx("span", { "aria-hidden": "true", children: " *" }) : null] }), _jsxs("span", { id: `${id}-count`, className: "vx-count", children: [ui.t('list.count', { n: total, max: MAX_MENU_ITEMS }), " \u00B7 ", depth === 1 ? ui.t('menu.oneLevel') : ui.t('menu.levels', { n: depth })] }), items.length ? _jsx("ul", { className: "vx-menu-list", children: rows(items, []) }) : _jsx("p", { className: "vx-muted", children: ui.t('menu.empty') }), _jsx("div", { className: "vx-actions", children: _jsx("button", { type: "button", className: "vx-btn", "data-field": items.length ? undefined : name, onFocus: onFocus, disabled: total >= MAX_MENU_ITEMS, onClick: () => set(menuOps.add(items, [])), children: ui.t('list.add') }) })] }));
91
93
  }
92
94
  export const MENU_STYLES = `
93
95
  .vx-menu-list{list-style:none;margin:4px 0 0;padding:0;display:flex;flex-direction:column;gap:6px}
94
- .vx-menu-sub{margin-left:10px;padding-left:10px;border-left:2px solid #e4e4e7}
96
+ .vx-menu-sub{margin-inline-start:10px;padding-inline-start:10px;border-inline-start:2px solid #e4e4e7}
95
97
  .vx-menu-item{display:flex;flex-direction:column;gap:4px}
96
98
  .vx-menu-row{display:grid;grid-template-columns:1fr 1fr;gap:4px}
97
99
  .vx-menu-row input{width:100%;padding:6px 8px;border:1px solid #d4d4d8;border-radius:8px;background:#fff;min-width:0}
98
100
  .vx-menu-tools{display:flex;flex-wrap:wrap;gap:4px;align-items:center}
99
- .vx-menu-tab{display:flex;align-items:center;gap:4px;font-size:12px;color:#52525b;margin-right:auto}
101
+ .vx-menu-tab{display:flex;align-items:center;gap:4px;font-size:12px;color:#52525b;margin-inline-end:auto}
100
102
  .vx-slide-card{border:1px solid #e4e4e7;border-radius:10px;padding:8px;display:flex;flex-direction:column;gap:4px;margin:4px 0 6px}
101
103
  .vx-slide-card .vx-field{margin:0}
102
- .vx-result{appearance:none;display:block;width:100%;text-align:left;border:0;background:transparent;padding:6px;border-radius:6px;cursor:pointer;font-size:13px}
104
+ .vx-result{appearance:none;display:block;width:100%;text-align:start;border:0;background:transparent;padding:6px;border-radius:6px;cursor:pointer;font-size:13px}
103
105
  .vx-result:hover{background:#f4f4f5}
104
106
  .vx-mini{appearance:none;cursor:pointer;border:1px solid #e4e4e7;background:#fff;border-radius:6px;min-width:26px;height:24px;padding:0 6px;font-size:12px}
105
107
  .vx-mini:disabled{opacity:.4;cursor:not-allowed}
@@ -1,4 +1,33 @@
1
1
  import { type ReactNode } from 'react';
2
+ import { type EditorTranslator, type LabelMap } from './i18n.js';
3
+ interface FieldDef {
4
+ type: 'text' | 'richText' | 'media' | 'link' | 'number' | 'boolean' | 'select' | 'menu' | 'video' | 'slides' | 'map' | 'chart' | 'component' | 'list';
5
+ label?: string;
6
+ /** The site's label in each language, when it gave more than one. */
7
+ labels?: LabelMap;
8
+ required?: boolean;
9
+ max?: number;
10
+ options?: string[];
11
+ /** select: a display label per stored value, per language. */
12
+ optionLabels?: Record<string, LabelMap>;
13
+ /** list: the item field a collapsed item shows. */
14
+ titleField?: string;
15
+ /** menu: levels of sub-menus allowed (1 to 3). */
16
+ depth?: number;
17
+ /** component: the components the developer registered for this place, by name. */
18
+ components?: Record<string, {
19
+ label?: string;
20
+ labels?: LabelMap;
21
+ version: number;
22
+ fields: Record<string, FieldDef>;
23
+ }>;
24
+ /** list: each item's fields. */
25
+ fields?: Record<string, FieldDef>;
26
+ /** list: items may have a first and a last day they show on. */
27
+ schedule?: boolean;
28
+ /** menu: the icons an item may have. */
29
+ icons?: string[];
30
+ }
2
31
  /**
3
32
  * How the overlay reaches VeroXM. By default through this site's own
4
33
  * /api/veroxm route (which holds the editor token in an httpOnly cookie);
@@ -34,3 +63,9 @@ export declare function VeroxmEditorOverlay({ onChange, tools }: EditorOverlayPr
34
63
  * False when no editor overlay is on the page.
35
64
  */
36
65
  export declare function openEditorSlot(name: string, locale?: string): boolean;
66
+ /**
67
+ * A short name for a collapsed list item: the list's titleField, else its first required text field, else its first
68
+ * text field (a link's text counts), else "Item 3".
69
+ */
70
+ export declare function itemTitle(fields: Record<string, FieldDef>, item: Record<string, unknown>, i: number, titleField?: string, ui?: EditorTranslator): string;
71
+ export {};