@inshapardaz/likhari-react 0.1.14 → 0.1.15-dev.118

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 (42) hide show
  1. package/dist/EditorRoot.d.ts.map +1 -1
  2. package/dist/EditorRoot.js +3 -1
  3. package/dist/blocks/FootnoteListNode.d.ts +46 -0
  4. package/dist/blocks/FootnoteListNode.d.ts.map +1 -0
  5. package/dist/blocks/FootnoteListNode.js +117 -0
  6. package/dist/blocks/FootnoteNode.d.ts +38 -0
  7. package/dist/blocks/FootnoteNode.d.ts.map +1 -0
  8. package/dist/blocks/FootnoteNode.js +90 -0
  9. package/dist/blocks/LayoutNode.d.ts +54 -0
  10. package/dist/blocks/LayoutNode.d.ts.map +1 -0
  11. package/dist/blocks/LayoutNode.js +138 -0
  12. package/dist/blocks/footnoteActions.d.ts +9 -0
  13. package/dist/blocks/footnoteActions.d.ts.map +1 -0
  14. package/dist/blocks/footnoteActions.js +42 -0
  15. package/dist/blocks/layoutActions.d.ts +12 -0
  16. package/dist/blocks/layoutActions.d.ts.map +1 -0
  17. package/dist/blocks/layoutActions.js +39 -0
  18. package/dist/components/LayoutDialog.d.ts +11 -0
  19. package/dist/components/LayoutDialog.d.ts.map +1 -0
  20. package/dist/components/LayoutDialog.js +24 -0
  21. package/dist/components/TableDialog.d.ts +2 -2
  22. package/dist/components/TableDialog.js +2 -2
  23. package/dist/components/Toolbar.d.ts.map +1 -1
  24. package/dist/components/Toolbar.js +36 -9
  25. package/dist/i18n/strings.d.ts +8 -0
  26. package/dist/i18n/strings.d.ts.map +1 -1
  27. package/dist/i18n/strings.js +24 -0
  28. package/dist/nodes.d.ts.map +1 -1
  29. package/dist/nodes.js +8 -0
  30. package/dist/plugins/FootnotePlugin.d.ts +9 -0
  31. package/dist/plugins/FootnotePlugin.d.ts.map +1 -0
  32. package/dist/plugins/FootnotePlugin.js +51 -0
  33. package/dist/plugins/LayoutPlugin.d.ts +9 -0
  34. package/dist/plugins/LayoutPlugin.d.ts.map +1 -0
  35. package/dist/plugins/LayoutPlugin.js +23 -0
  36. package/dist/table/tableActions.d.ts +13 -0
  37. package/dist/table/tableActions.d.ts.map +1 -1
  38. package/dist/table/tableActions.js +86 -2
  39. package/dist/theme/editor.css +76 -4
  40. package/dist/theme/editorTheme.d.ts.map +1 -1
  41. package/dist/theme/editorTheme.js +11 -0
  42. package/package.json +1 -1
@@ -178,6 +178,10 @@
178
178
  font-family: 'IBM Plex Serif', Georgia, serif;
179
179
  font-size: 15px;
180
180
  line-height: 1.75;
181
+ /* Scopes the footnote-reference counter to the whole document (editor.css
182
+ footnote rules below), so numbering is consistent regardless of which
183
+ blocks the references happen to sit in. */
184
+ counter-reset: likhari-footnote-ref;
181
185
  }
182
186
 
183
187
  .likhari-content-editable[dir='rtl'] {
@@ -186,6 +190,25 @@
186
190
  line-height: 2.3;
187
191
  }
188
192
 
193
+ /* Per-block direction (requirements doc §3.2, "mixed-direction documents"):
194
+ Lexical detects each block's own direction from its first strong-direction
195
+ character and tags it with one of these theme classes independently of
196
+ the document's overall locale — an Urdu paragraph inside an English essay,
197
+ or an English heading inside an Urdu document, gets its own script-correct
198
+ font rather than inheriting the canvas-wide default. Set directly on the
199
+ block, so it wins over the inherited rule above regardless of specificity. */
200
+ .likhari-rtl {
201
+ font-family: 'Noto Nastaliq Urdu', serif;
202
+ font-size: 20px;
203
+ line-height: 2.3;
204
+ }
205
+
206
+ .likhari-ltr {
207
+ font-family: 'IBM Plex Serif', Georgia, serif;
208
+ font-size: 15px;
209
+ line-height: 1.75;
210
+ }
211
+
189
212
  .likhari-placeholder {
190
213
  position: absolute;
191
214
  top: 20px;
@@ -298,10 +321,59 @@
298
321
  }
299
322
  }
300
323
 
301
- /* Tables — cell merge/split is deliberately out of scope for now (a flagged
302
- open risk, lexical-editor-spec.md §12 item 3, needing its own scope
303
- decision); TablePlugin is configured with hasCellMerge={false} to keep
304
- every table a plain grid until that's resolved. */
324
+ /* Columns layout (lexical-editor-spec.md §4.9) — a CSS grid row whose
325
+ column count/widths come from the node's own inline style, not this
326
+ stylesheet, so each container can differ. */
327
+ .likhari-layout-container {
328
+ display: grid;
329
+ gap: 24px;
330
+ margin: 0 0 1em 0;
331
+ }
332
+
333
+ .likhari-layout-item {
334
+ min-width: 0;
335
+ overflow-wrap: break-word;
336
+ }
337
+
338
+ .likhari-layout-item > :last-child {
339
+ margin-bottom: 0;
340
+ }
341
+
342
+ /* Footnotes (lexical-editor-spec.md §4.10). The bracketed number on both
343
+ the inline reference and its list entry is a CSS counter, not stored
344
+ state — Lexical insert/delete/reorder of the underlying nodes renumbers
345
+ both sequences automatically as long as list items stay in the same
346
+ order their references were inserted (FootnotePlugin's insert command
347
+ always appends in that order). */
348
+ .likhari-footnote-ref {
349
+ counter-increment: likhari-footnote-ref;
350
+ cursor: default;
351
+ }
352
+
353
+ .likhari-footnote-ref::after {
354
+ content: '[' counter(likhari-footnote-ref) ']';
355
+ }
356
+
357
+ .likhari-footnote-list {
358
+ counter-reset: likhari-footnote-item;
359
+ list-style: none;
360
+ margin: 2em 0 0 0;
361
+ padding-inline-start: 1.5em;
362
+ border-top: 1px solid var(--editor-line);
363
+ padding-top: 0.75em;
364
+ font-size: 0.9em;
365
+ color: var(--editor-ink-soft);
366
+ }
367
+
368
+ .likhari-footnote-item {
369
+ counter-increment: likhari-footnote-item;
370
+ margin: 0.3em 0;
371
+ }
372
+
373
+ .likhari-footnote-item::marker {
374
+ content: '[' counter(likhari-footnote-item) '] ';
375
+ }
376
+
305
377
  .likhari-table {
306
378
  border-collapse: collapse;
307
379
  margin: 1em 0;
@@ -1 +1 @@
1
- {"version":3,"file":"editorTheme.d.ts","sourceRoot":"","sources":["../../src/theme/editorTheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,kBAoCzB,CAAC"}
1
+ {"version":3,"file":"editorTheme.d.ts","sourceRoot":"","sources":["../../src/theme/editorTheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,kBA+CzB,CAAC"}
@@ -4,6 +4,12 @@
4
4
  * (the "headless + default theme" requirement, UI spec §10).
5
5
  */
6
6
  export const editorTheme = {
7
+ // Applied by Lexical's reconciler to each top-level block based on that
8
+ // block's own detected direction — see the comment in editor.css. This is
9
+ // the per-block half of mixed-direction document support (requirements
10
+ // doc §3.2); the EditorRoot `dir` prop handles the whole-document default.
11
+ ltr: 'likhari-ltr',
12
+ rtl: 'likhari-rtl',
7
13
  paragraph: 'likhari-paragraph',
8
14
  quote: 'likhari-quote',
9
15
  heading: {
@@ -34,6 +40,11 @@ export const editorTheme = {
34
40
  hr: 'likhari-hr',
35
41
  image: 'likhari-image-block',
36
42
  pageBreak: 'likhari-page-break',
43
+ layoutContainer: 'likhari-layout-container',
44
+ layoutItem: 'likhari-layout-item',
45
+ footnoteReference: 'likhari-footnote-ref',
46
+ footnoteList: 'likhari-footnote-list',
47
+ footnoteItem: 'likhari-footnote-item',
37
48
  table: 'likhari-table',
38
49
  tableRow: 'likhari-table-row',
39
50
  tableCell: 'likhari-table-cell',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inshapardaz/likhari-react",
3
- "version": "0.1.14",
3
+ "version": "0.1.15-dev.118",
4
4
  "description": "React implementation of the Likhari editor, built on @lexical/react.",
5
5
  "license": "MIT",
6
6
  "repository": {