@inshapardaz/likhari-react 0.1.6-dev.60 → 0.1.6-dev.64

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.
Files changed (39) hide show
  1. package/dist/EditorRoot.d.ts +10 -1
  2. package/dist/EditorRoot.d.ts.map +1 -1
  3. package/dist/EditorRoot.js +14 -5
  4. package/dist/PortalTargetContext.d.ts +16 -0
  5. package/dist/PortalTargetContext.d.ts.map +1 -0
  6. package/dist/PortalTargetContext.js +18 -0
  7. package/dist/components/LinkDialog.d.ts.map +1 -1
  8. package/dist/components/LinkDialog.js +7 -3
  9. package/dist/components/Toolbar.d.ts +4 -1
  10. package/dist/components/Toolbar.d.ts.map +1 -1
  11. package/dist/components/Toolbar.js +193 -30
  12. package/dist/i18n/index.d.ts +4 -0
  13. package/dist/i18n/index.d.ts.map +1 -0
  14. package/dist/i18n/index.js +2 -0
  15. package/dist/i18n/strings.d.ts +158 -0
  16. package/dist/i18n/strings.d.ts.map +1 -0
  17. package/dist/i18n/strings.js +425 -0
  18. package/dist/i18n/useStrings.d.ts +10 -0
  19. package/dist/i18n/useStrings.d.ts.map +1 -0
  20. package/dist/i18n/useStrings.js +14 -0
  21. package/dist/image/ImageComponent.d.ts.map +1 -1
  22. package/dist/image/ImageComponent.js +7 -3
  23. package/dist/image/ImageCropDialog.d.ts.map +1 -1
  24. package/dist/image/ImageCropDialog.js +13 -6
  25. package/dist/image/ImageCropper.d.ts.map +1 -1
  26. package/dist/image/ImageCropper.js +3 -1
  27. package/dist/image/ImageDialog.d.ts.map +1 -1
  28. package/dist/image/ImageDialog.js +30 -16
  29. package/dist/index.d.ts +2 -0
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +1 -0
  32. package/dist/theme/EditorThemeProvider.d.ts +4 -1
  33. package/dist/theme/EditorThemeProvider.d.ts.map +1 -1
  34. package/dist/theme/EditorThemeProvider.js +24 -2
  35. package/dist/theme/accentColor.d.ts +43 -0
  36. package/dist/theme/accentColor.d.ts.map +1 -0
  37. package/dist/theme/accentColor.js +84 -0
  38. package/dist/theme/editor.css +18 -0
  39. package/package.json +1 -1
@@ -0,0 +1,158 @@
1
+ /**
2
+ * UI localization strings for the editor's own chrome (toolbar, dialogs,
3
+ * menus, placeholders) — see docs/lexical-editor-spec.md §3.2. This is
4
+ * separate from content direction/fonts (handled in EditorRoot) and from
5
+ * Markdown/HTML/plain-text format translation, which is out of scope here.
6
+ */
7
+ /** Re-exported from EditorRoot's existing prop type so there is a single
8
+ * source of truth for which locales the editor knows about. */
9
+ export type Locale = 'en' | 'ur' | 'pa-shahmukhi';
10
+ export interface Strings {
11
+ editor: {
12
+ /** Default placeholder shown in an empty editor (overridden by an explicit `placeholder` prop). */
13
+ placeholder: string;
14
+ /** aria-label on the contenteditable itself. */
15
+ contentLabel: string;
16
+ /** window.confirm() prompt shown by EditorRef.confirmDiscard() when there are unsaved changes. */
17
+ confirmDiscard: string;
18
+ };
19
+ common: {
20
+ cancel: string;
21
+ save: string;
22
+ insert: string;
23
+ };
24
+ toolbar: {
25
+ /** aria-label on the toolbar's own role="toolbar" container. */
26
+ ariaLabel: string;
27
+ save: string;
28
+ undo: string;
29
+ redo: string;
30
+ formattingLabel: string;
31
+ bold: string;
32
+ italic: string;
33
+ underline: string;
34
+ fontFamily: string;
35
+ fontFamilyPlaceholder: string;
36
+ fontSize: string;
37
+ fontSizePlaceholder: string;
38
+ noMatch: string;
39
+ alignment: string;
40
+ linkOptions: string;
41
+ insertLink: string;
42
+ insertImage: string;
43
+ poetryBlocks: string;
44
+ comingSoon: (label: string) => string;
45
+ autocorrect: string;
46
+ textCleanup: string;
47
+ spellChecker: string;
48
+ moreFormatting: string;
49
+ strikethrough: string;
50
+ superscript: string;
51
+ subscript: string;
52
+ uppercase: string;
53
+ lowercase: string;
54
+ capitalize: string;
55
+ clearFormatting: string;
56
+ outdent: string;
57
+ indent: string;
58
+ formattingOptions: {
59
+ paragraph: string;
60
+ heading: (level: number) => string;
61
+ numberedList: string;
62
+ bulletList: string;
63
+ taskList: string;
64
+ quote: string;
65
+ };
66
+ alignOptions: {
67
+ start: string;
68
+ center: string;
69
+ end: string;
70
+ justify: string;
71
+ left: string;
72
+ right: string;
73
+ };
74
+ };
75
+ link: {
76
+ menuLabel: string;
77
+ noUrl: string;
78
+ editLink: string;
79
+ removeLink: string;
80
+ };
81
+ linkDialog: {
82
+ titleInsert: string;
83
+ titleEdit: string;
84
+ urlLabel: string;
85
+ urlPlaceholder: string;
86
+ textLabel: string;
87
+ textPlaceholder: string;
88
+ invalidUrl: string;
89
+ apply: string;
90
+ };
91
+ imageDialog: {
92
+ titleInsert: string;
93
+ titleEdit: string;
94
+ currentImage: string;
95
+ fromUrl: string;
96
+ upload: string;
97
+ embeddedInDocument: string;
98
+ linkedFrom: (src: string) => string;
99
+ convertButton: string;
100
+ convertHint: string;
101
+ imageUrlLabel: string;
102
+ imageUrlPlaceholder: string;
103
+ embedCopyLabel: string;
104
+ embedCopyDescription: string;
105
+ convertedFromUrl: string;
106
+ fileLabel: string;
107
+ filePlaceholder: string;
108
+ fileDescription: (maxSizeMB: number, storedInDocument: boolean) => string;
109
+ altTextLabel: string;
110
+ altTextDescription: string;
111
+ captionLabel: string;
112
+ captionDescription: string;
113
+ errors: {
114
+ enterUrl: string;
115
+ chooseFile: string;
116
+ noImage: string;
117
+ uploadUnusable: string;
118
+ couldNotSave: string;
119
+ couldNotConvert: string;
120
+ couldNotReadFile: string;
121
+ largerThan: (maxSizeMB: number) => string;
122
+ };
123
+ };
124
+ imageCropDialog: {
125
+ title: string;
126
+ sizeLabel: string;
127
+ widthLabel: string;
128
+ heightLabel: string;
129
+ autoPlaceholder: string;
130
+ keepProportions: string;
131
+ originalSize: string;
132
+ dragHint: (natural: {
133
+ width: number;
134
+ height: number;
135
+ } | null) => string;
136
+ errors: {
137
+ uploadUnusable: string;
138
+ couldNotSave: string;
139
+ largerThan: (maxSizeMB: number) => string;
140
+ };
141
+ };
142
+ imageMenu: {
143
+ editImage: string;
144
+ convertToEmbedded: string;
145
+ cropResize: string;
146
+ addCaption: string;
147
+ editCaption: string;
148
+ removeCaption: string;
149
+ deleteImage: string;
150
+ resizeImage: string;
151
+ };
152
+ }
153
+ export declare const STRINGS: Record<Locale, Strings>;
154
+ /** Returns the strings dictionary for `locale`, defensively falling back to
155
+ * `en` for any locale not present in `STRINGS` (e.g. a future locale value
156
+ * passed by a caller on an older type definition). */
157
+ export declare function getStrings(locale: Locale): Strings;
158
+ //# sourceMappingURL=strings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../../src/i18n/strings.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;+DAC+D;AAC/D,MAAM,MAAM,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,cAAc,CAAC;AAElD,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE;QACN,mGAAmG;QACnG,WAAW,EAAE,MAAM,CAAC;QACpB,gDAAgD;QAChD,YAAY,EAAE,MAAM,CAAC;QACrB,kGAAkG;QAClG,cAAc,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,MAAM,EAAE;QACN,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,OAAO,EAAE;QACP,gEAAgE;QAChE,SAAS,EAAE,MAAM,CAAC;QAClB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,eAAe,EAAE,MAAM,CAAC;QACxB,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,qBAAqB,EAAE,MAAM,CAAC;QAC9B,QAAQ,EAAE,MAAM,CAAC;QACjB,mBAAmB,EAAE,MAAM,CAAC;QAC5B,OAAO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AAE,MAAM,CAAC;YACzB,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;SAC3C,CAAC;KACH,CAAC;IACF,eAAe,EAAE;QACf,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,WAAW,EAAE,MAAM,CAAC;QACpB,eAAe,EAAE,MAAM,CAAC;QACxB,eAAe,EAAE,MAAM,CAAC;QACxB,YAAY,EAAE,MAAM,CAAC;QACrB,QAAQ,EAAE,CAAC,OAAO,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,GAAG,IAAI,KAAK,MAAM,CAAC;QACxE,MAAM,EAAE;YACN,cAAc,EAAE,MAAM,CAAC;YACvB,YAAY,EAAE,MAAM,CAAC;YACrB,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;SAC3C,CAAC;KACH,CAAC;IACF,SAAS,EAAE;QACT,SAAS,EAAE,MAAM,CAAC;QAClB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,WAAW,EAAE,MAAM,CAAC;QACpB,aAAa,EAAE,MAAM,CAAC;QACtB,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;CACH;AAgaD,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAI3C,CAAC;AAEF;;sDAEsD;AACtD,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAElD"}
@@ -0,0 +1,425 @@
1
+ /**
2
+ * UI localization strings for the editor's own chrome (toolbar, dialogs,
3
+ * menus, placeholders) — see docs/lexical-editor-spec.md §3.2. This is
4
+ * separate from content direction/fonts (handled in EditorRoot) and from
5
+ * Markdown/HTML/plain-text format translation, which is out of scope here.
6
+ */
7
+ const en = {
8
+ editor: {
9
+ placeholder: 'Start writing…',
10
+ contentLabel: 'Editor content',
11
+ confirmDiscard: 'You have unsaved changes. Discard them?',
12
+ },
13
+ common: {
14
+ cancel: 'Cancel',
15
+ save: 'Save',
16
+ insert: 'Insert',
17
+ },
18
+ toolbar: {
19
+ ariaLabel: 'Formatting',
20
+ save: 'Save',
21
+ undo: 'Undo',
22
+ redo: 'Redo',
23
+ formattingLabel: 'Formatting',
24
+ bold: 'Bold',
25
+ italic: 'Italic',
26
+ underline: 'Underline',
27
+ fontFamily: 'Font family',
28
+ fontFamilyPlaceholder: 'Font',
29
+ fontSize: 'Font size',
30
+ fontSizePlaceholder: 'Size',
31
+ noMatch: 'No match',
32
+ alignment: 'Alignment',
33
+ linkOptions: 'Link options',
34
+ insertLink: 'Insert link (Ctrl+K)',
35
+ insertImage: 'Insert image',
36
+ poetryBlocks: 'Poetry blocks',
37
+ comingSoon: (label) => `${label} (coming soon)`,
38
+ autocorrect: 'Auto-correct',
39
+ textCleanup: 'Text cleanup',
40
+ spellChecker: 'Spell-checker',
41
+ moreFormatting: 'More formatting',
42
+ strikethrough: 'Strikethrough',
43
+ superscript: 'Superscript',
44
+ subscript: 'Subscript',
45
+ uppercase: 'UPPERCASE',
46
+ lowercase: 'lowercase',
47
+ capitalize: 'Capitalize',
48
+ clearFormatting: 'Clear formatting',
49
+ outdent: 'Outdent',
50
+ indent: 'Indent',
51
+ formattingOptions: {
52
+ paragraph: 'Paragraph',
53
+ heading: (level) => `Heading ${level}`,
54
+ numberedList: 'Numbered list',
55
+ bulletList: 'Bullet list',
56
+ taskList: 'Task list',
57
+ quote: 'Quote',
58
+ },
59
+ alignOptions: {
60
+ start: 'Align start',
61
+ center: 'Align center',
62
+ end: 'Align end',
63
+ justify: 'Justify',
64
+ left: 'Align left',
65
+ right: 'Align right',
66
+ },
67
+ },
68
+ link: {
69
+ menuLabel: 'Link',
70
+ noUrl: '(no URL)',
71
+ editLink: 'Edit link',
72
+ removeLink: 'Remove link',
73
+ },
74
+ linkDialog: {
75
+ titleInsert: 'Insert link',
76
+ titleEdit: 'Edit link',
77
+ urlLabel: 'URL',
78
+ urlPlaceholder: 'https://example.com',
79
+ textLabel: 'Text',
80
+ textPlaceholder: 'Link text (defaults to the URL)',
81
+ invalidUrl: 'Enter a valid http(s), mailto, tel or relative URL',
82
+ apply: 'Apply',
83
+ },
84
+ imageDialog: {
85
+ titleInsert: 'Insert image',
86
+ titleEdit: 'Edit image',
87
+ currentImage: 'Current image',
88
+ fromUrl: 'From URL',
89
+ upload: 'Upload',
90
+ embeddedInDocument: 'Embedded in the document',
91
+ linkedFrom: (src) => `Linked from ${src}`,
92
+ convertButton: 'Convert to embedded image',
93
+ convertHint: 'Downloads a copy into the document, so it can be cropped, rotated and resized.',
94
+ imageUrlLabel: 'Image URL',
95
+ imageUrlPlaceholder: 'https://example.com/photo.jpg',
96
+ embedCopyLabel: 'Embed a copy in the document',
97
+ embedCopyDescription: 'Downloads the image so it can be edited and no longer depends on the URL.',
98
+ convertedFromUrl: 'Converted from the URL: a copy will be embedded in the document.',
99
+ fileLabel: 'Image file',
100
+ filePlaceholder: 'Choose an image',
101
+ fileDescription: (maxSizeMB, storedInDocument) => `Up to ${maxSizeMB} MB${storedInDocument ? '; stored inside the document' : ''}`,
102
+ altTextLabel: 'Alt text',
103
+ altTextDescription: 'Describes the image for screen readers',
104
+ captionLabel: 'Caption',
105
+ captionDescription: 'Shown under the image. Leave empty for none.',
106
+ errors: {
107
+ enterUrl: 'Enter an http(s) or relative image URL',
108
+ chooseFile: 'Choose an image file',
109
+ noImage: 'No image',
110
+ uploadUnusable: 'The upload handler returned an unusable image URL',
111
+ couldNotSave: 'Could not save the image',
112
+ couldNotConvert: 'Could not convert the image',
113
+ couldNotReadFile: 'Could not read the file',
114
+ largerThan: (maxSizeMB) => `Image is larger than ${maxSizeMB} MB`,
115
+ },
116
+ },
117
+ imageCropDialog: {
118
+ title: 'Crop & resize',
119
+ sizeLabel: 'Size',
120
+ widthLabel: 'Width (px)',
121
+ heightLabel: 'Height (px)',
122
+ autoPlaceholder: 'Auto',
123
+ keepProportions: 'Keep proportions',
124
+ originalSize: 'Original size',
125
+ dragHint: (natural) => `You can also drag the corner handle on a selected image. ${natural ? `Original: ${natural.width} × ${natural.height} px.` : ''}`,
126
+ errors: {
127
+ uploadUnusable: 'The upload handler returned an unusable image URL',
128
+ couldNotSave: 'Could not save the image',
129
+ largerThan: (maxSizeMB) => `Image is larger than ${maxSizeMB} MB`,
130
+ },
131
+ },
132
+ imageMenu: {
133
+ editImage: 'Edit image…',
134
+ convertToEmbedded: 'Convert to embedded image',
135
+ cropResize: 'Crop & resize…',
136
+ addCaption: 'Add caption…',
137
+ editCaption: 'Edit caption…',
138
+ removeCaption: 'Remove caption',
139
+ deleteImage: 'Delete image',
140
+ resizeImage: 'Resize image',
141
+ },
142
+ };
143
+ const ur = {
144
+ editor: {
145
+ placeholder: 'لکھنا شروع کریں…',
146
+ contentLabel: 'ایڈیٹر کا مواد',
147
+ confirmDiscard: 'آپ کی غیر محفوظ شدہ تبدیلیاں ہیں۔ کیا انہیں رد کر دیا جائے؟',
148
+ },
149
+ common: {
150
+ cancel: 'منسوخ کریں',
151
+ save: 'محفوظ کریں',
152
+ insert: 'شامل کریں',
153
+ },
154
+ toolbar: {
155
+ ariaLabel: 'فارمیٹنگ',
156
+ save: 'محفوظ کریں',
157
+ undo: 'کالعدم کریں',
158
+ redo: 'دوبارہ کریں',
159
+ formattingLabel: 'فارمیٹنگ',
160
+ bold: 'موٹا',
161
+ italic: 'ترچھا',
162
+ underline: 'زیرِ خط',
163
+ fontFamily: 'فونٹ کا خاندان',
164
+ fontFamilyPlaceholder: 'فونٹ',
165
+ fontSize: 'فونٹ کا سائز',
166
+ fontSizePlaceholder: 'سائز',
167
+ noMatch: 'کوئی مماثلت نہیں',
168
+ alignment: 'سیدھ',
169
+ linkOptions: 'لنک کے اختیارات',
170
+ insertLink: 'لنک شامل کریں (Ctrl+K)',
171
+ insertImage: 'تصویر شامل کریں',
172
+ poetryBlocks: 'شاعری کے بلاکس',
173
+ comingSoon: (label) => `${label} (جلد آ رہا ہے)`,
174
+ autocorrect: 'خودکار تصحیح',
175
+ textCleanup: 'متن کی صفائی',
176
+ spellChecker: 'ہجے چیک کرنے والا',
177
+ moreFormatting: 'مزید فارمیٹنگ',
178
+ strikethrough: 'خط زدہ',
179
+ superscript: 'بالا نویس',
180
+ subscript: 'زیریں نویس',
181
+ uppercase: 'بڑے حروف',
182
+ lowercase: 'چھوٹے حروف',
183
+ capitalize: 'پہلا حرف بڑا',
184
+ clearFormatting: 'فارمیٹنگ ختم کریں',
185
+ outdent: 'حاشیہ کم کریں',
186
+ indent: 'حاشیہ بڑھائیں',
187
+ formattingOptions: {
188
+ paragraph: 'پیراگراف',
189
+ heading: (level) => `عنوان ${level}`,
190
+ numberedList: 'نمبردار فہرست',
191
+ bulletList: 'بلٹ فہرست',
192
+ taskList: 'ٹاسک فہرست',
193
+ quote: 'اقتباس',
194
+ },
195
+ alignOptions: {
196
+ start: 'ابتدائی سیدھ',
197
+ center: 'درمیانی سیدھ',
198
+ end: 'اختتامی سیدھ',
199
+ justify: 'دو طرفہ سیدھ',
200
+ left: 'بائیں سیدھ',
201
+ right: 'دائیں سیدھ',
202
+ },
203
+ },
204
+ link: {
205
+ menuLabel: 'لنک',
206
+ noUrl: '(کوئی یو آر ایل نہیں)',
207
+ editLink: 'لنک میں ترمیم کریں',
208
+ removeLink: 'لنک ہٹائیں',
209
+ },
210
+ linkDialog: {
211
+ titleInsert: 'لنک شامل کریں',
212
+ titleEdit: 'لنک میں ترمیم کریں',
213
+ urlLabel: 'یو آر ایل',
214
+ urlPlaceholder: 'https://example.com',
215
+ textLabel: 'عبارت',
216
+ textPlaceholder: 'لنک کی عبارت (نہ دینے پر یو آر ایل ہی استعمال ہوگا)',
217
+ invalidUrl: 'براہِ کرم ایک درست http(s)، mailto، tel یا رشتہ دار یو آر ایل درج کریں',
218
+ apply: 'لاگو کریں',
219
+ },
220
+ imageDialog: {
221
+ titleInsert: 'تصویر شامل کریں',
222
+ titleEdit: 'تصویر میں ترمیم کریں',
223
+ currentImage: 'موجودہ تصویر',
224
+ fromUrl: 'یو آر ایل سے',
225
+ upload: 'اپ لوڈ',
226
+ embeddedInDocument: 'دستاویز میں شامل',
227
+ linkedFrom: (src) => `${src} سے منسلک`,
228
+ convertButton: 'شامل شدہ تصویر میں تبدیل کریں',
229
+ convertHint: 'دستاویز میں ایک نقل ڈاؤن لوڈ کرتا ہے، تاکہ اسے کاٹا، گھمایا اور سائز تبدیل کیا جا سکے۔',
230
+ imageUrlLabel: 'تصویر کا یو آر ایل',
231
+ imageUrlPlaceholder: 'https://example.com/photo.jpg',
232
+ embedCopyLabel: 'دستاویز میں ایک نقل شامل کریں',
233
+ embedCopyDescription: 'تصویر ڈاؤن لوڈ کرتا ہے تاکہ اس میں ترمیم کی جا سکے اور یہ یو آر ایل پر منحصر نہ رہے۔',
234
+ convertedFromUrl: 'یو آر ایل سے تبدیل شدہ: ایک نقل دستاویز میں شامل کی جائے گی۔',
235
+ fileLabel: 'تصویر کی فائل',
236
+ filePlaceholder: 'ایک تصویر منتخب کریں',
237
+ fileDescription: (maxSizeMB, storedInDocument) => `${maxSizeMB} ایم بی تک${storedInDocument ? '؛ دستاویز کے اندر محفوظ ہوتی ہے' : ''}`,
238
+ altTextLabel: 'متبادل متن',
239
+ altTextDescription: 'سکرین ریڈرز کے لیے تصویر کی تفصیل بیان کرتا ہے',
240
+ captionLabel: 'کیپشن',
241
+ captionDescription: 'تصویر کے نیچے دکھایا جاتا ہے۔ نہ چاہیں تو خالی چھوڑ دیں۔',
242
+ errors: {
243
+ enterUrl: 'ایک http(s) یا رشتہ دار تصویر یو آر ایل درج کریں',
244
+ chooseFile: 'ایک تصویر فائل منتخب کریں',
245
+ noImage: 'کوئی تصویر نہیں',
246
+ uploadUnusable: 'اپ لوڈ ہینڈلر نے ناقابلِ استعمال یو آر ایل واپس کیا',
247
+ couldNotSave: 'تصویر محفوظ نہیں ہو سکی',
248
+ couldNotConvert: 'تصویر تبدیل نہیں ہو سکی',
249
+ couldNotReadFile: 'فائل پڑھی نہیں جا سکی',
250
+ largerThan: (maxSizeMB) => `تصویر ${maxSizeMB} ایم بی سے بڑی ہے`,
251
+ },
252
+ },
253
+ imageCropDialog: {
254
+ title: 'کاٹیں اور سائز تبدیل کریں',
255
+ sizeLabel: 'سائز',
256
+ widthLabel: 'چوڑائی (px)',
257
+ heightLabel: 'اونچائی (px)',
258
+ autoPlaceholder: 'خودکار',
259
+ keepProportions: 'تناسب برقرار رکھیں',
260
+ originalSize: 'اصل سائز',
261
+ dragHint: (natural) => `منتخب شدہ تصویر پر کارنر ہینڈل کھینچ کر بھی سائز تبدیل کیا جا سکتا ہے۔ ${natural ? `اصل: ${natural.width} × ${natural.height} پکسل۔` : ''}`,
262
+ errors: {
263
+ uploadUnusable: 'اپ لوڈ ہینڈلر نے ناقابلِ استعمال یو آر ایل واپس کیا',
264
+ couldNotSave: 'تصویر محفوظ نہیں ہو سکی',
265
+ largerThan: (maxSizeMB) => `تصویر ${maxSizeMB} ایم بی سے بڑی ہے`,
266
+ },
267
+ },
268
+ imageMenu: {
269
+ editImage: 'تصویر میں ترمیم کریں…',
270
+ convertToEmbedded: 'شامل شدہ تصویر میں تبدیل کریں',
271
+ cropResize: 'کاٹیں اور سائز تبدیل کریں…',
272
+ addCaption: 'کیپشن شامل کریں…',
273
+ editCaption: 'کیپشن میں ترمیم کریں…',
274
+ removeCaption: 'کیپشن ہٹائیں',
275
+ deleteImage: 'تصویر حذف کریں',
276
+ resizeImage: 'تصویر کا سائز تبدیل کریں',
277
+ },
278
+ };
279
+ const paShahmukhi = {
280
+ editor: {
281
+ placeholder: 'لکھنا شروع کرو…',
282
+ contentLabel: 'ایڈیٹر دی سامگری',
283
+ confirmDiscard: 'تہاڈیاں کجھ تبدیلیاں سنبھالیاں نئیں گئیاں۔ کی ایہناں نوں رد کر دیئے؟',
284
+ },
285
+ common: {
286
+ cancel: 'رد کرو',
287
+ save: 'سنبھالو',
288
+ insert: 'پاؤ',
289
+ },
290
+ toolbar: {
291
+ ariaLabel: 'فارمیٹنگ',
292
+ save: 'سنبھالو',
293
+ undo: 'پہلاں جیہا کرو',
294
+ redo: 'مُڑ کرو',
295
+ formattingLabel: 'فارمیٹنگ',
296
+ bold: 'گہرا',
297
+ italic: 'ترچھا',
298
+ underline: 'تھلے لکیر',
299
+ fontFamily: 'فونٹ خاندان',
300
+ fontFamilyPlaceholder: 'فونٹ',
301
+ fontSize: 'فونٹ دا سائز',
302
+ fontSizePlaceholder: 'سائز',
303
+ noMatch: 'کوئی نئیں ملیا',
304
+ alignment: 'سیدھ',
305
+ linkOptions: 'لنک دے اختیار',
306
+ insertLink: 'لنک پاؤ (Ctrl+K)',
307
+ insertImage: 'تصویر پاؤ',
308
+ poetryBlocks: 'شاعری بلاک',
309
+ comingSoon: (label) => `${label} (چھیتی آ رہا اے)`,
310
+ autocorrect: 'خودکار درستی',
311
+ textCleanup: 'متن دی صفائی',
312
+ spellChecker: 'ہجے چیکر',
313
+ moreFormatting: 'ہور فارمیٹنگ',
314
+ strikethrough: 'کٹی لکیر',
315
+ superscript: 'اُتلا لکھت',
316
+ subscript: 'تلا لکھت',
317
+ uppercase: 'وڈے حرف',
318
+ lowercase: 'نکے حرف',
319
+ capitalize: 'پہلا حرف وڈا',
320
+ clearFormatting: 'فارمیٹنگ ہٹاؤ',
321
+ outdent: 'حاشیہ گھٹاؤ',
322
+ indent: 'حاشیہ ودھاؤ',
323
+ formattingOptions: {
324
+ paragraph: 'پیراگراف',
325
+ heading: (level) => `سرلیکھ ${level}`,
326
+ numberedList: 'نمبردار لسٹ',
327
+ bulletList: 'بلٹ لسٹ',
328
+ taskList: 'ٹاسک لسٹ',
329
+ quote: 'حوالہ',
330
+ },
331
+ alignOptions: {
332
+ start: 'شروع دی سیدھ',
333
+ center: 'وچکار دی سیدھ',
334
+ end: 'آخری سیدھ',
335
+ justify: 'دوویں پاسے سیدھ',
336
+ left: 'بائیں سیدھ',
337
+ right: 'سجے سیدھ',
338
+ },
339
+ },
340
+ link: {
341
+ menuLabel: 'لنک',
342
+ noUrl: '(کوئی یو آر ایل نئیں)',
343
+ editLink: 'لنک وچ تبدیلی کرو',
344
+ removeLink: 'لنک ہٹاؤ',
345
+ },
346
+ linkDialog: {
347
+ titleInsert: 'لنک پاؤ',
348
+ titleEdit: 'لنک وچ تبدیلی کرو',
349
+ urlLabel: 'یو آر ایل',
350
+ urlPlaceholder: 'https://example.com',
351
+ textLabel: 'لکھت',
352
+ textPlaceholder: 'لنک دی لکھت (نہ دین تے یو آر ایل ای ورتیا جاوے گا)',
353
+ invalidUrl: 'کِرپا کر کے صحیح http(s)، mailto، tel یا نسبتی یو آر ایل پاؤ',
354
+ apply: 'لاگو کرو',
355
+ },
356
+ imageDialog: {
357
+ titleInsert: 'تصویر پاؤ',
358
+ titleEdit: 'تصویر وچ تبدیلی کرو',
359
+ currentImage: 'موجودہ تصویر',
360
+ fromUrl: 'یو آر ایل توں',
361
+ upload: 'اپ لوڈ',
362
+ embeddedInDocument: 'دستاویز وچ شامل',
363
+ linkedFrom: (src) => `${src} توں لنک کیتا گیا`,
364
+ convertButton: 'شامل تصویر وچ بدلو',
365
+ convertHint: 'دستاویز وچ اک کاپی ڈاؤن لوڈ کردا اے، تاں جو ایہنوں کٹیا، گھمایا تے سائز بدلیا جا سکے۔',
366
+ imageUrlLabel: 'تصویر دا یو آر ایل',
367
+ imageUrlPlaceholder: 'https://example.com/photo.jpg',
368
+ embedCopyLabel: 'دستاویز وچ اک کاپی شامل کرو',
369
+ embedCopyDescription: 'تصویر ڈاؤن لوڈ کردا اے تاں جو ایہنوں تبدیل کیتا جا سکے تے ایہہ یو آر ایل تے منحصر نہ رہے۔',
370
+ convertedFromUrl: 'یو آر ایل توں بدلیا گیا: اک کاپی دستاویز وچ شامل کیتی جاوے گی۔',
371
+ fileLabel: 'تصویر دی فائل',
372
+ filePlaceholder: 'اک تصویر چُنو',
373
+ fileDescription: (maxSizeMB, storedInDocument) => `${maxSizeMB} ایم بی تیک${storedInDocument ? '؛ دستاویز دے اندر سنبھالی جاندی اے' : ''}`,
374
+ altTextLabel: 'بدل متن',
375
+ altTextDescription: 'سکرین ریڈرز لئی تصویر دی وضاحت کردا اے',
376
+ captionLabel: 'کیپشن',
377
+ captionDescription: 'تصویر دے تھلے دکھایا جاندا اے۔ نہ چاہیدا تے خالی چھڈ دیو۔',
378
+ errors: {
379
+ enterUrl: 'اک http(s) یا نسبتی تصویر یو آر ایل پاؤ',
380
+ chooseFile: 'اک تصویر فائل چُنو',
381
+ noImage: 'کوئی تصویر نئیں',
382
+ uploadUnusable: 'اپ لوڈ ہینڈلر نے ناکارآمد یو آر ایل موڑیا',
383
+ couldNotSave: 'تصویر سنبھالی نئیں جا سکی',
384
+ couldNotConvert: 'تصویر بدلی نئیں جا سکی',
385
+ couldNotReadFile: 'فائل پڑھی نئیں جا سکی',
386
+ largerThan: (maxSizeMB) => `تصویر ${maxSizeMB} ایم بی توں وڈی اے`,
387
+ },
388
+ },
389
+ imageCropDialog: {
390
+ title: 'کٹو تے سائز بدلو',
391
+ sizeLabel: 'سائز',
392
+ widthLabel: 'چوڑائی (px)',
393
+ heightLabel: 'اُچائی (px)',
394
+ autoPlaceholder: 'خودکار',
395
+ keepProportions: 'تناسب رکھو',
396
+ originalSize: 'اصلی سائز',
397
+ dragHint: (natural) => `چُنی ہوئی تصویر تے کارنر ہینڈل گھسیٹ کے وی سائز بدلیا جا سکدا اے۔ ${natural ? `اصلی: ${natural.width} × ${natural.height} پکسل۔` : ''}`,
398
+ errors: {
399
+ uploadUnusable: 'اپ لوڈ ہینڈلر نے ناکارآمد یو آر ایل موڑیا',
400
+ couldNotSave: 'تصویر سنبھالی نئیں جا سکی',
401
+ largerThan: (maxSizeMB) => `تصویر ${maxSizeMB} ایم بی توں وڈی اے`,
402
+ },
403
+ },
404
+ imageMenu: {
405
+ editImage: 'تصویر وچ تبدیلی کرو…',
406
+ convertToEmbedded: 'شامل تصویر وچ بدلو',
407
+ cropResize: 'کٹو تے سائز بدلو…',
408
+ addCaption: 'کیپشن شامل کرو…',
409
+ editCaption: 'کیپشن وچ تبدیلی کرو…',
410
+ removeCaption: 'کیپشن ہٹاؤ',
411
+ deleteImage: 'تصویر مٹاؤ',
412
+ resizeImage: 'تصویر دا سائز بدلو',
413
+ },
414
+ };
415
+ export const STRINGS = {
416
+ en,
417
+ ur,
418
+ 'pa-shahmukhi': paShahmukhi,
419
+ };
420
+ /** Returns the strings dictionary for `locale`, defensively falling back to
421
+ * `en` for any locale not present in `STRINGS` (e.g. a future locale value
422
+ * passed by a caller on an older type definition). */
423
+ export function getStrings(locale) {
424
+ return STRINGS[locale] ?? STRINGS.en;
425
+ }
@@ -0,0 +1,10 @@
1
+ import { type Locale, type Strings } from './strings.js';
2
+ /** Returns the translated strings dictionary for `locale`. */
3
+ export declare function useStrings(locale: Locale): Strings;
4
+ /** Provided once at `EditorRoot`'s top level so components that aren't
5
+ * direct children (dialogs, context menus) can reach the current locale's
6
+ * strings without threading a `locale` prop through every intermediate
7
+ * component. */
8
+ export declare const UiStringsContext: import("react").Context<Strings>;
9
+ export declare function useUiStrings(): Strings;
10
+ //# sourceMappingURL=useStrings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStrings.d.ts","sourceRoot":"","sources":["../../src/i18n/useStrings.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,MAAM,EAAE,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAElE,8DAA8D;AAC9D,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAElD;AAED;;;gBAGgB;AAChB,eAAO,MAAM,gBAAgB,kCAA2C,CAAC;AAEzE,wBAAgB,YAAY,IAAI,OAAO,CAEtC"}
@@ -0,0 +1,14 @@
1
+ import { createContext, useContext, useMemo } from 'react';
2
+ import { getStrings } from './strings.js';
3
+ /** Returns the translated strings dictionary for `locale`. */
4
+ export function useStrings(locale) {
5
+ return useMemo(() => getStrings(locale), [locale]);
6
+ }
7
+ /** Provided once at `EditorRoot`'s top level so components that aren't
8
+ * direct children (dialogs, context menus) can reach the current locale's
9
+ * strings without threading a `locale` prop through every intermediate
10
+ * component. */
11
+ export const UiStringsContext = createContext(getStrings('en'));
12
+ export function useUiStrings() {
13
+ return useContext(UiStringsContext);
14
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"ImageComponent.d.ts","sourceRoot":"","sources":["../../src/image/ImageComponent.tsx"],"names":[],"mappings":"AAKA,OAAO,EASL,KAAK,OAAO,EACb,MAAM,SAAS,CAAC;AAKjB,OAAO,KAAK,EAAE,aAAa,EAAa,MAAM,aAAa,CAAC;AAU5D,UAAU,mBAAmB;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,aAAa,CAAC;IACxB,yFAAyF;IACzF,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,mBAAmB,+BAyP9G"}
1
+ {"version":3,"file":"ImageComponent.d.ts","sourceRoot":"","sources":["../../src/image/ImageComponent.tsx"],"names":[],"mappings":"AAKA,OAAO,EASL,KAAK,OAAO,EACb,MAAM,SAAS,CAAC;AAOjB,OAAO,KAAK,EAAE,aAAa,EAAa,MAAM,aAAa,CAAC;AAU5D,UAAU,mBAAmB;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,aAAa,CAAC;IACxB,yFAAyF;IACzF,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,mBAAmB,+BA4P9G"}