oasis-editor 0.0.10 → 0.0.12

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.
@@ -1422,6 +1422,14 @@ const en = {
1422
1422
  "toolbar.redo": "Redo last undone change",
1423
1423
  "toolbar.insert": "Insert",
1424
1424
  "toolbar.image": "Image",
1425
+ "toolbar.imageCaption": "Image caption",
1426
+ "toolbar.shapes": "Shapes",
1427
+ "toolbar.shape.rect": "Rectangle",
1428
+ "toolbar.shape.roundRect": "Rounded rectangle",
1429
+ "toolbar.shape.ellipse": "Ellipse",
1430
+ "toolbar.shape.triangle": "Triangle",
1431
+ "toolbar.shape.rtTriangle": "Right triangle",
1432
+ "toolbar.shape.diamond": "Diamond",
1425
1433
  "toolbar.table": "Table",
1426
1434
  "toolbar.pageNumber": "Page #",
1427
1435
  "toolbar.totalPages": "Total Pages",
@@ -1646,6 +1654,9 @@ const en = {
1646
1654
  "dialog.imageAlt.title": "Image Alt Text",
1647
1655
  "dialog.imageAlt.label": "Description (Alt text)",
1648
1656
  "dialog.imageAlt.placeholder": "Describe the image",
1657
+ "dialog.imageCaption.title": "Image Caption",
1658
+ "dialog.imageCaption.label": "Caption",
1659
+ "dialog.imageCaption.placeholder": "Enter a caption",
1649
1660
  "dialog.link.title": "Insert Link",
1650
1661
  "dialog.link.label": "Link URL",
1651
1662
  "dialog.link.placeholder": "https://example.com",
@@ -1803,6 +1814,14 @@ const ptBR = {
1803
1814
  "toolbar.redo": "Refazer última alteração",
1804
1815
  "toolbar.insert": "Inserir",
1805
1816
  "toolbar.image": "Imagem",
1817
+ "toolbar.imageCaption": "Legenda da imagem",
1818
+ "toolbar.shapes": "Formas",
1819
+ "toolbar.shape.rect": "Retângulo",
1820
+ "toolbar.shape.roundRect": "Retângulo arredondado",
1821
+ "toolbar.shape.ellipse": "Elipse",
1822
+ "toolbar.shape.triangle": "Triângulo",
1823
+ "toolbar.shape.rtTriangle": "Triângulo retângulo",
1824
+ "toolbar.shape.diamond": "Losango",
1806
1825
  "toolbar.table": "Tabela",
1807
1826
  "toolbar.pageNumber": "Nº de Página",
1808
1827
  "toolbar.totalPages": "Total de Páginas",
@@ -2027,6 +2046,9 @@ const ptBR = {
2027
2046
  "dialog.imageAlt.title": "Texto Alternativo da Imagem",
2028
2047
  "dialog.imageAlt.label": "Descrição (Texto Alt)",
2029
2048
  "dialog.imageAlt.placeholder": "Descreva a imagem",
2049
+ "dialog.imageCaption.title": "Legenda da imagem",
2050
+ "dialog.imageCaption.label": "Legenda",
2051
+ "dialog.imageCaption.placeholder": "Digite a legenda",
2030
2052
  "dialog.link.title": "Inserir Link",
2031
2053
  "dialog.link.label": "URL do Link",
2032
2054
  "dialog.link.placeholder": "https://exemplo.com",
@@ -2288,7 +2310,7 @@ function OasisEditorAppLazy(props = {}) {
2288
2310
  onCleanup(() => {
2289
2311
  cancelled = true;
2290
2312
  });
2291
- import("./OasisEditorApp-B31W8Nmj.js").then((m) => {
2313
+ import("./OasisEditorApp-DsSNl4Fj.js").then((m) => {
2292
2314
  cancelled = true;
2293
2315
  setProgress(1);
2294
2316
  setTimeout(() => setApp(() => m.OasisEditorApp), 180);
@@ -3620,6 +3642,23 @@ const DEFAULT_EDITOR_STYLES = {
3620
3642
  textStyle: {
3621
3643
  superscript: true
3622
3644
  }
3645
+ },
3646
+ Caption: {
3647
+ id: "Caption",
3648
+ name: "Caption",
3649
+ type: "paragraph",
3650
+ basedOn: "normal",
3651
+ nextStyle: "normal",
3652
+ paragraphStyle: {
3653
+ align: "center",
3654
+ spacingBefore: 4,
3655
+ spacingAfter: 8
3656
+ },
3657
+ textStyle: {
3658
+ fontFamily: "Calibri, sans-serif",
3659
+ fontSize: 12,
3660
+ italic: true
3661
+ }
3623
3662
  }
3624
3663
  };
3625
3664
  function createEditorDocument(blocks, pageSettings, sections, styles, metadata, assets) {
@@ -4221,6 +4260,7 @@ const OASIS_BUILTIN_COMMANDS = [
4221
4260
  "importDocument",
4222
4261
  "insertImage",
4223
4262
  "editImageAlt",
4263
+ "insertImageCaption",
4224
4264
  "outdent",
4225
4265
  "indent",
4226
4266
  "togglePageBreakBefore",
@@ -4482,6 +4522,13 @@ const defaultMenuItems = [
4482
4522
  command: "insertImage",
4483
4523
  icon: "image"
4484
4524
  },
4525
+ {
4526
+ id: "insert_image_caption",
4527
+ path: "Insert/Image Caption",
4528
+ labelKey: "toolbar.imageCaption",
4529
+ command: "insertImageCaption",
4530
+ icon: "subtitles"
4531
+ },
4485
4532
  {
4486
4533
  id: "insert_table",
4487
4534
  path: "Insert/Table",
@@ -11129,11 +11176,11 @@ function mergeIntervals(intervals) {
11129
11176
  }
11130
11177
  return merged;
11131
11178
  }
11132
- function coveredIntervalsAtScanline(polygon, y) {
11179
+ function coveredIntervalsAtScanline(polygon2, y) {
11133
11180
  const xs = [];
11134
- for (let i = 0; i < polygon.length; i += 1) {
11135
- const a = polygon[i];
11136
- const b = polygon[(i + 1) % polygon.length];
11181
+ for (let i = 0; i < polygon2.length; i += 1) {
11182
+ const a = polygon2[i];
11183
+ const b = polygon2[(i + 1) % polygon2.length];
11137
11184
  const crosses = a.y <= y && b.y > y || b.y <= y && a.y > y;
11138
11185
  if (!crosses) continue;
11139
11186
  const t2 = (y - a.y) / (b.y - a.y);
@@ -11146,12 +11193,12 @@ function coveredIntervalsAtScanline(polygon, y) {
11146
11193
  }
11147
11194
  return intervals;
11148
11195
  }
11149
- function polygonCoveredIntervals(polygon, top, bottom) {
11196
+ function polygonCoveredIntervals(polygon2, top, bottom) {
11150
11197
  const samples = 5;
11151
11198
  const collected = [];
11152
11199
  for (let s = 0; s < samples; s += 1) {
11153
11200
  const y = bottom === top ? top : top + (bottom - top) * s / (samples - 1);
11154
- collected.push(...coveredIntervalsAtScanline(polygon, y));
11201
+ collected.push(...coveredIntervalsAtScanline(polygon2, y));
11155
11202
  }
11156
11203
  return mergeIntervals(collected);
11157
11204
  }
@@ -11816,7 +11863,7 @@ function collectParagraphFloatingExclusions(options) {
11816
11863
  });
11817
11864
  const expanded = expandForWrap(rawRect, floating);
11818
11865
  const wrap = floating.wrap ?? "square";
11819
- const polygon = image && image.wrapPolygon && image.wrapPolygon.length >= 3 && (wrap === "tight" || wrap === "through") && !image.rotation ? image.wrapPolygon.map((point) => ({
11866
+ const polygon2 = image && image.wrapPolygon && image.wrapPolygon.length >= 3 && (wrap === "tight" || wrap === "through") && !image.rotation ? image.wrapPolygon.map((point) => ({
11820
11867
  x: rawRect.x + point.x * rawRect.width,
11821
11868
  y: rawRect.y + point.y * rawRect.height
11822
11869
  })) : void 0;
@@ -11824,7 +11871,7 @@ function collectParagraphFloatingExclusions(options) {
11824
11871
  ...expanded,
11825
11872
  wrap,
11826
11873
  sourceRunId: fragment.runId,
11827
- ...polygon ? { polygon } : {}
11874
+ ...polygon2 ? { polygon: polygon2 } : {}
11828
11875
  });
11829
11876
  }
11830
11877
  return exclusions;
@@ -14481,6 +14528,175 @@ function drawTable(ctx, table, tableSegment, state, originX, originY, contentWid
14481
14528
  });
14482
14529
  }
14483
14530
  }
14531
+ const KAPPA = 0.5522847498307936;
14532
+ function getPresetPathSegments(preset, x, y, width, height) {
14533
+ const right = x + width;
14534
+ const bottom = y + height;
14535
+ const cx = x + width / 2;
14536
+ const cy = y + height / 2;
14537
+ switch (preset) {
14538
+ case "roundRect":
14539
+ return roundRectSegments(
14540
+ x,
14541
+ y,
14542
+ width,
14543
+ height,
14544
+ Math.min(width, height) * 0.1
14545
+ );
14546
+ case "ellipse":
14547
+ return ellipseSegments(cx, cy, width / 2, height / 2);
14548
+ case "triangle":
14549
+ return polygon([
14550
+ [cx, y],
14551
+ [right, bottom],
14552
+ [x, bottom]
14553
+ ]);
14554
+ case "rtTriangle":
14555
+ return polygon([
14556
+ [x, y],
14557
+ [x, bottom],
14558
+ [right, bottom]
14559
+ ]);
14560
+ case "diamond":
14561
+ return polygon([
14562
+ [cx, y],
14563
+ [right, cy],
14564
+ [cx, bottom],
14565
+ [x, cy]
14566
+ ]);
14567
+ case "rect":
14568
+ default:
14569
+ return polygon([
14570
+ [x, y],
14571
+ [right, y],
14572
+ [right, bottom],
14573
+ [x, bottom]
14574
+ ]);
14575
+ }
14576
+ }
14577
+ function polygon(points) {
14578
+ const segments = [];
14579
+ points.forEach(([px, py], index) => {
14580
+ segments.push(
14581
+ index === 0 ? { type: "move", x: px, y: py } : { type: "line", x: px, y: py }
14582
+ );
14583
+ });
14584
+ segments.push({ type: "close" });
14585
+ return segments;
14586
+ }
14587
+ function ellipseSegments(cx, cy, rx, ry) {
14588
+ const ox = rx * KAPPA;
14589
+ const oy = ry * KAPPA;
14590
+ return [
14591
+ { type: "move", x: cx - rx, y: cy },
14592
+ {
14593
+ type: "cubic",
14594
+ x1: cx - rx,
14595
+ y1: cy - oy,
14596
+ x2: cx - ox,
14597
+ y2: cy - ry,
14598
+ x: cx,
14599
+ y: cy - ry
14600
+ },
14601
+ {
14602
+ type: "cubic",
14603
+ x1: cx + ox,
14604
+ y1: cy - ry,
14605
+ x2: cx + rx,
14606
+ y2: cy - oy,
14607
+ x: cx + rx,
14608
+ y: cy
14609
+ },
14610
+ {
14611
+ type: "cubic",
14612
+ x1: cx + rx,
14613
+ y1: cy + oy,
14614
+ x2: cx + ox,
14615
+ y2: cy + ry,
14616
+ x: cx,
14617
+ y: cy + ry
14618
+ },
14619
+ {
14620
+ type: "cubic",
14621
+ x1: cx - ox,
14622
+ y1: cy + ry,
14623
+ x2: cx - rx,
14624
+ y2: cy + oy,
14625
+ x: cx - rx,
14626
+ y: cy
14627
+ },
14628
+ { type: "close" }
14629
+ ];
14630
+ }
14631
+ function roundRectSegments(x, y, width, height, radius) {
14632
+ const r = Math.min(radius, width / 2, height / 2);
14633
+ const right = x + width;
14634
+ const bottom = y + height;
14635
+ const o = r * (1 - KAPPA);
14636
+ return [
14637
+ { type: "move", x: x + r, y },
14638
+ { type: "line", x: right - r, y },
14639
+ {
14640
+ type: "cubic",
14641
+ x1: right - o,
14642
+ y1: y,
14643
+ x2: right,
14644
+ y2: y + o,
14645
+ x: right,
14646
+ y: y + r
14647
+ },
14648
+ { type: "line", x: right, y: bottom - r },
14649
+ {
14650
+ type: "cubic",
14651
+ x1: right,
14652
+ y1: bottom - o,
14653
+ x2: right - o,
14654
+ y2: bottom,
14655
+ x: right - r,
14656
+ y: bottom
14657
+ },
14658
+ { type: "line", x: x + r, y: bottom },
14659
+ {
14660
+ type: "cubic",
14661
+ x1: x + o,
14662
+ y1: bottom,
14663
+ x2: x,
14664
+ y2: bottom - o,
14665
+ x,
14666
+ y: bottom - r
14667
+ },
14668
+ { type: "line", x, y: y + r },
14669
+ { type: "cubic", x1: x, y1: y + o, x2: x + o, y2: y, x: x + r, y },
14670
+ { type: "close" }
14671
+ ];
14672
+ }
14673
+ function buildPresetPath(preset, x, y, width, height) {
14674
+ const path = new Path2D();
14675
+ for (const segment of getPresetPathSegments(preset, x, y, width, height)) {
14676
+ switch (segment.type) {
14677
+ case "move":
14678
+ path.moveTo(segment.x, segment.y);
14679
+ break;
14680
+ case "line":
14681
+ path.lineTo(segment.x, segment.y);
14682
+ break;
14683
+ case "cubic":
14684
+ path.bezierCurveTo(
14685
+ segment.x1,
14686
+ segment.y1,
14687
+ segment.x2,
14688
+ segment.y2,
14689
+ segment.x,
14690
+ segment.y
14691
+ );
14692
+ break;
14693
+ case "close":
14694
+ path.closePath();
14695
+ break;
14696
+ }
14697
+ }
14698
+ return path;
14699
+ }
14484
14700
  const TEXT_BOX_AUTOFIT_MEASURE_HEIGHT = 1e5;
14485
14701
  const TEXT_BOX_AUTOFIT_SAFETY_PX = 2;
14486
14702
  function getTextBoxPadding(textBox) {
@@ -14538,19 +14754,20 @@ function resolveTextBoxRenderHeight(textBox, state, pageIndex) {
14538
14754
  return measureTextBoxNaturalHeight(textBox, state, pageIndex);
14539
14755
  }
14540
14756
  function drawTextBoxShape(ctx, textBox, x, y, width, height) {
14541
- var _a, _b, _c;
14757
+ var _a, _b, _c, _d;
14542
14758
  const fill = (_a = textBox.shape) == null ? void 0 : _a.fill;
14543
14759
  const borderColor = (_b = textBox.shape) == null ? void 0 : _b.borderColor;
14544
14760
  const borderWidth = ((_c = textBox.shape) == null ? void 0 : _c.borderWidthPt) ?? (borderColor ? 0.75 : 0);
14761
+ const path = buildPresetPath((_d = textBox.shape) == null ? void 0 : _d.preset, x, y, width, height);
14545
14762
  ctx.save();
14546
14763
  if (fill) {
14547
14764
  ctx.fillStyle = fill;
14548
- ctx.fillRect(x, y, width, height);
14765
+ ctx.fill(path);
14549
14766
  }
14550
14767
  if (borderColor && borderWidth > 0) {
14551
14768
  ctx.strokeStyle = borderColor;
14552
14769
  ctx.lineWidth = Math.max(1, borderWidth * (96 / 72));
14553
- ctx.strokeRect(x, y, width, height);
14770
+ ctx.stroke(path);
14554
14771
  }
14555
14772
  ctx.restore();
14556
14773
  }
@@ -30926,13 +31143,13 @@ function parseAnchorWrap$1(anchor) {
30926
31143
  }
30927
31144
  const WRAP_POLYGON_DENOMINATOR = 21600;
30928
31145
  function parseWrapPolygon(anchor) {
30929
- const polygon = findElementDeep(anchor, "wrapPolygon");
30930
- if (!polygon) {
31146
+ const polygon2 = findElementDeep(anchor, "wrapPolygon");
31147
+ if (!polygon2) {
30931
31148
  return void 0;
30932
31149
  }
30933
31150
  const points = [];
30934
- for (let index = 0; index < polygon.childNodes.length; index += 1) {
30935
- const node = polygon.childNodes[index];
31151
+ for (let index = 0; index < polygon2.childNodes.length; index += 1) {
31152
+ const node = polygon2.childNodes[index];
30936
31153
  if ((node == null ? void 0 : node.nodeType) !== 1) continue;
30937
31154
  const el = node;
30938
31155
  if (el.localName !== "start" && el.localName !== "lineTo") continue;
@@ -33452,7 +33669,7 @@ function importDocxInWorker(buffer, options = {}) {
33452
33669
  const worker = new Worker(
33453
33670
  new URL(
33454
33671
  /* @vite-ignore */
33455
- "" + new URL("assets/importDocxWorker-DbiKelzX.js", import.meta.url).href,
33672
+ "" + new URL("assets/importDocxWorker-CtcRQ7NG.js", import.meta.url).href,
33456
33673
  import.meta.url
33457
33674
  ),
33458
33675
  {
@@ -36763,12 +36980,26 @@ const RIBBON_PLACEMENTS = {
36763
36980
  "editor-toolbar-superscript": { tab: "home", group: "font", row: 2 },
36764
36981
  "editor-toolbar-subscript": { tab: "home", group: "font", row: 2 },
36765
36982
  "sep-format": { tab: "home", group: "font", row: 2 },
36766
- "editor-toolbar-insert-image": { tab: "insert", group: "illustrations", row: 1 },
36983
+ "editor-toolbar-insert-image": {
36984
+ tab: "insert",
36985
+ group: "illustrations",
36986
+ row: 1
36987
+ },
36988
+ "editor-toolbar-insert-shape": {
36989
+ tab: "insert",
36990
+ group: "illustrations",
36991
+ row: 2
36992
+ },
36767
36993
  "editor-toolbar-insert-table": { tab: "insert", group: "tables", row: 1 },
36768
36994
  "editor-toolbar-link": { tab: "insert", group: "links", row: 1 },
36769
36995
  "editor-toolbar-unlink": { tab: "insert", group: "links", row: 2 },
36770
36996
  "editor-toolbar-footnote": { tab: "references", group: "footnotes", row: 1 },
36771
36997
  "editor-toolbar-image-alt": { tab: "insert", group: "accessibility", row: 2 },
36998
+ "editor-toolbar-image-caption": {
36999
+ tab: "insert",
37000
+ group: "accessibility",
37001
+ row: 1
37002
+ },
36772
37003
  "sep-insert": { tab: "insert", group: "accessibility", row: 2 },
36773
37004
  "editor-toolbar-align-left": { tab: "home", group: "paragraph", row: 2 },
36774
37005
  "editor-toolbar-align-center": { tab: "home", group: "paragraph", row: 2 },
@@ -36779,7 +37010,11 @@ const RIBBON_PLACEMENTS = {
36779
37010
  "editor-toolbar-list-outdent": { tab: "home", group: "paragraph", row: 1 },
36780
37011
  "editor-toolbar-list-indent": { tab: "home", group: "paragraph", row: 1 },
36781
37012
  "editor-toolbar-list-options": { tab: "home", group: "paragraph", row: 1 },
36782
- "editor-toolbar-line-spacing-control": { tab: "home", group: "paragraph", row: 2 },
37013
+ "editor-toolbar-line-spacing-control": {
37014
+ tab: "home",
37015
+ group: "paragraph",
37016
+ row: 2
37017
+ },
36783
37018
  "sep-paragraph": { tab: "home", group: "paragraph", row: 2 },
36784
37019
  "editor-toolbar-metrics": { tab: "layout", group: "paragraph", row: 1 },
36785
37020
  "sep-metrics": { tab: "layout", group: "paragraph", row: 2 },
@@ -37059,6 +37294,72 @@ function createDefaultToolbarPreset() {
37059
37294
  tooltipKey: "toolbar.image",
37060
37295
  command: "insertImage"
37061
37296
  });
37297
+ items.push({
37298
+ type: "menu",
37299
+ id: "editor-toolbar-insert-shape",
37300
+ testId: "editor-toolbar-insert-shape",
37301
+ iconName: "shapes",
37302
+ tooltipKey: "toolbar.shapes",
37303
+ content: {
37304
+ kind: "items",
37305
+ items: [
37306
+ {
37307
+ type: "button",
37308
+ id: "editor-toolbar-shape-rect",
37309
+ testId: "editor-toolbar-shape-rect",
37310
+ labelKey: "toolbar.shape.rect",
37311
+ wide: true,
37312
+ tooltipKey: "toolbar.shape.rect",
37313
+ command: { name: "insertShape", payload: "rect" }
37314
+ },
37315
+ {
37316
+ type: "button",
37317
+ id: "editor-toolbar-shape-roundRect",
37318
+ testId: "editor-toolbar-shape-roundRect",
37319
+ labelKey: "toolbar.shape.roundRect",
37320
+ wide: true,
37321
+ tooltipKey: "toolbar.shape.roundRect",
37322
+ command: { name: "insertShape", payload: "roundRect" }
37323
+ },
37324
+ {
37325
+ type: "button",
37326
+ id: "editor-toolbar-shape-ellipse",
37327
+ testId: "editor-toolbar-shape-ellipse",
37328
+ labelKey: "toolbar.shape.ellipse",
37329
+ wide: true,
37330
+ tooltipKey: "toolbar.shape.ellipse",
37331
+ command: { name: "insertShape", payload: "ellipse" }
37332
+ },
37333
+ {
37334
+ type: "button",
37335
+ id: "editor-toolbar-shape-triangle",
37336
+ testId: "editor-toolbar-shape-triangle",
37337
+ labelKey: "toolbar.shape.triangle",
37338
+ wide: true,
37339
+ tooltipKey: "toolbar.shape.triangle",
37340
+ command: { name: "insertShape", payload: "triangle" }
37341
+ },
37342
+ {
37343
+ type: "button",
37344
+ id: "editor-toolbar-shape-rtTriangle",
37345
+ testId: "editor-toolbar-shape-rtTriangle",
37346
+ labelKey: "toolbar.shape.rtTriangle",
37347
+ wide: true,
37348
+ tooltipKey: "toolbar.shape.rtTriangle",
37349
+ command: { name: "insertShape", payload: "rtTriangle" }
37350
+ },
37351
+ {
37352
+ type: "button",
37353
+ id: "editor-toolbar-shape-diamond",
37354
+ testId: "editor-toolbar-shape-diamond",
37355
+ labelKey: "toolbar.shape.diamond",
37356
+ wide: true,
37357
+ tooltipKey: "toolbar.shape.diamond",
37358
+ command: { name: "insertShape", payload: "diamond" }
37359
+ }
37360
+ ]
37361
+ }
37362
+ });
37062
37363
  items.push({
37063
37364
  type: "gridPicker",
37064
37365
  id: "editor-toolbar-insert-table",
@@ -37099,6 +37400,15 @@ function createDefaultToolbarPreset() {
37099
37400
  command: "editImageAlt",
37100
37401
  isVisible: (api) => api.commands.state("editImageAlt").isEnabled
37101
37402
  });
37403
+ items.push({
37404
+ type: "button",
37405
+ id: "editor-toolbar-image-caption",
37406
+ testId: "editor-toolbar-image-caption",
37407
+ iconName: "subtitles",
37408
+ tooltipKey: "toolbar.imageCaption",
37409
+ command: "insertImageCaption",
37410
+ isVisible: (api) => api.commands.state("insertImageCaption").isEnabled
37411
+ });
37102
37412
  items.push({ type: "separator", id: "sep-insert" });
37103
37413
  for (const button of ALIGN_BUTTONS) {
37104
37414
  items.push({
@@ -37196,6 +37506,7 @@ const OASIS_TOOLBAR_ITEMS = {
37196
37506
  unlink: "editor-toolbar-unlink",
37197
37507
  footnote: "editor-toolbar-footnote",
37198
37508
  imageAlt: "editor-toolbar-image-alt",
37509
+ imageCaption: "editor-toolbar-image-caption",
37199
37510
  alignLeft: "editor-toolbar-align-left",
37200
37511
  alignCenter: "editor-toolbar-align-center",
37201
37512
  alignRight: "editor-toolbar-align-right",
@@ -37227,6 +37538,7 @@ const OASIS_MENU_ITEMS = {
37227
37538
  viewParagraphMarks: "view_paragraph_marks",
37228
37539
  viewPreciseFonts: "view_precise_fonts",
37229
37540
  insertImage: "insert_image",
37541
+ insertImageCaption: "insert_image_caption",
37230
37542
  insertTable: "insert_table",
37231
37543
  insertLink: "insert_link",
37232
37544
  insertFootnote: "insert_footnote",
@@ -37246,196 +37558,201 @@ const OASIS_MENU_ITEMS = {
37246
37558
  formatListsNumbered: "format_lists_numbered"
37247
37559
  };
37248
37560
  export {
37249
- PX_PER_POINT$2 as $,
37250
- renumberFootnotes as A,
37251
- iterateFootnoteReferenceRuns as B,
37252
- getFootnoteDisplayMarker as C,
37253
- createSignal as D,
37254
- createEffect as E,
37255
- onCleanup as F,
37256
- buildCanvasLayoutSnapshot as G,
37257
- on as H,
37258
- onMount as I,
37259
- debounce as J,
37260
- unwrap as K,
37261
- getDocumentParagraphs as L,
37262
- getDocumentSectionsCanonical as M,
37263
- createEditorDocument as N,
37264
- getPageContentWidth as O,
37265
- getDocumentPageSettings as P,
37266
- getTableCellContentWidthForParagraph as Q,
37267
- resolveResizedDimensions as R,
37268
- resolveTextBoxRenderHeight as S,
37269
- resolveEffectiveParagraphStyle as T,
37270
- resolveEffectiveTextStyleForParagraph as U,
37271
- iterateEndnoteReferenceRuns as V,
37272
- JSZip as W,
37273
- imageContentTypeDefaults as X,
37274
- imageExtensionFromMime as Y,
37275
- pxToPt as Z,
37276
- textStyleToFontSizePt as _,
37277
- createEditorStyledRun as a,
37278
- memo as a$,
37279
- DEFAULT_FONT_SIZE_PX as a0,
37280
- isDoubleUnderlineStyle as a1,
37281
- isWavyUnderlineStyle as a2,
37282
- underlineStyleLineWidthPx as a3,
37283
- underlineStyleDashArray as a4,
37284
- getListLabelInset as a5,
37285
- getParagraphBorderInsets as a6,
37286
- buildSegmentTable as a7,
37287
- buildCanvasTableLayout as a8,
37288
- normalizeFamily as a9,
37289
- t as aA,
37290
- preciseFontModeVersion as aB,
37291
- isPreciseFontModeEnabled as aC,
37292
- togglePreciseFontMode as aD,
37293
- nextFontSizePt as aE,
37294
- previousFontSizePt as aF,
37295
- fontSizePtToPx as aG,
37296
- createDefaultToolbarPreset as aH,
37297
- defaultMenuItems as aI,
37298
- MenuRegistry as aJ,
37299
- createToolbarRegistry as aK,
37300
- Editor as aL,
37301
- resolveCommandRef as aM,
37302
- commandRefName as aN,
37303
- InlineShell as aO,
37304
- BalloonShell as aP,
37305
- DocumentShell as aQ,
37306
- createMemo as aR,
37307
- getCaretRectFromSnapshot as aS,
37308
- getParagraphRectFromSnapshot as aT,
37309
- createComponent as aU,
37310
- CaretOverlay as aV,
37311
- Show as aW,
37312
- createRenderEffect as aX,
37313
- style as aY,
37314
- setAttribute as aZ,
37315
- setStyleProperty as a_,
37316
- ROBOTO_FONT_FILES as aa,
37317
- loadFontAsset as ab,
37318
- OFFICE_COMPAT_FONT_FAMILIES as ac,
37319
- buildSfnt as ad,
37320
- defaultFontDecoderRegistry as ae,
37321
- SfntFontProgram as af,
37322
- collectPdfFontFamilies as ag,
37323
- projectDocumentLayout as ah,
37324
- getPageHeaderZoneTop as ai,
37325
- getPageBodyTop as aj,
37326
- findFootnoteReference as ak,
37327
- FOOTNOTE_MARKER_GUTTER_PX as al,
37328
- resolveImporterForFile as am,
37329
- createEditorStateFromDocument as an,
37330
- getDocumentParagraphsCanonical as ao,
37331
- getToolbarStyleState as ap,
37332
- STANDARD_FONT_SIZES_PT as aq,
37333
- fontSizePxToPt as ar,
37334
- probeLocalFontFamilies as as,
37335
- createInitialEditorState as at,
37336
- parseFontSizePtToPx as au,
37337
- formatFontSizePt as av,
37338
- listKindForTag as aw,
37339
- isParagraphTag as ax,
37340
- collectInlineRuns as ay,
37341
- parseParagraphStyle as az,
37342
- getParagraphLength as b,
37343
- SidePanelBody as b$,
37344
- template as b0,
37345
- insert as b1,
37346
- use as b2,
37347
- addEventListener as b3,
37348
- Dialog as b4,
37349
- delegateEvents as b5,
37350
- className as b6,
37351
- For as b7,
37352
- UNDERLINE_STYLE_OPTIONS as b8,
37353
- Tabs as b9,
37354
- OasisEditorLoading as bA,
37355
- createEditorLogger as bB,
37356
- getCachedCanvasImage as bC,
37357
- registerDomStatsSurface as bD,
37358
- Button as bE,
37359
- Checkbox as bF,
37360
- ColorPicker as bG,
37361
- CommandRegistry as bH,
37362
- DEFAULT_PALETTE as bI,
37363
- DialogFooter as bJ,
37364
- FloatingActionButton as bK,
37365
- GridPicker as bL,
37366
- IconButton as bM,
37367
- Menu as bN,
37368
- OASIS_BUILTIN_COMMANDS as bO,
37369
- OASIS_MENU_ITEMS as bP,
37370
- OASIS_TOOLBAR_ITEMS as bQ,
37371
- OasisEditorAppLazy as bR,
37372
- OasisEditorContainer as bS,
37373
- PluginCollection as bT,
37374
- Popover as bU,
37375
- RIBBON_TABS as bV,
37376
- RIBBON_TAB_DEFINITIONS as bW,
37377
- Select as bX,
37378
- SelectField as bY,
37379
- Separator as bZ,
37380
- SidePanel as b_,
37381
- measureParagraphMinContentWidthPx as ba,
37382
- getEditableBlocksForZone as bb,
37383
- findParagraphLocation as bc,
37384
- createSectionBoundaryParagraph as bd,
37385
- normalizePageSettings as be,
37386
- DEFAULT_EDITOR_PAGE_SETTINGS as bf,
37387
- markStart as bg,
37388
- markEnd as bh,
37389
- getParagraphEntries as bi,
37390
- getParagraphById as bj,
37391
- PluginUiHost as bk,
37392
- OasisEditorEditor as bl,
37393
- perfTimer as bm,
37394
- OasisBrandMark as bn,
37395
- setPreciseFontPreference as bo,
37396
- setWelcomeSeen as bp,
37397
- enablePreciseFontMode as bq,
37398
- createOasisEditorClient as br,
37399
- setLocale as bs,
37400
- startLongTaskObserver as bt,
37401
- installGlobalReport as bu,
37402
- applyStoredPreciseFontPreference as bv,
37403
- getWelcomeSeen as bw,
37404
- isLocalFontAccessSupported as bx,
37405
- EDITOR_SCROLL_PADDING_PX as by,
37406
- Toolbar as bz,
37561
+ buildSegmentTable as $,
37562
+ createFootnoteReferenceRun as A,
37563
+ renumberFootnotes as B,
37564
+ iterateFootnoteReferenceRuns as C,
37565
+ getFootnoteDisplayMarker as D,
37566
+ createSignal as E,
37567
+ createEffect as F,
37568
+ onCleanup as G,
37569
+ buildCanvasLayoutSnapshot as H,
37570
+ on as I,
37571
+ onMount as J,
37572
+ debounce as K,
37573
+ unwrap as L,
37574
+ getDocumentParagraphs as M,
37575
+ getDocumentSectionsCanonical as N,
37576
+ createEditorDocument as O,
37577
+ getPageContentWidth as P,
37578
+ getDocumentPageSettings as Q,
37579
+ getTableCellContentWidthForParagraph as R,
37580
+ resolveResizedDimensions as S,
37581
+ resolveTextBoxRenderHeight as T,
37582
+ resolveEffectiveParagraphStyle as U,
37583
+ resolveEffectiveTextStyleForParagraph as V,
37584
+ iterateEndnoteReferenceRuns as W,
37585
+ JSZip as X,
37586
+ imageContentTypeDefaults as Y,
37587
+ imageExtensionFromMime as Z,
37588
+ pxToPt as _,
37589
+ getParagraphLength as a,
37590
+ Show as a$,
37591
+ buildCanvasTableLayout as a0,
37592
+ resolveFloatingObjectRect as a1,
37593
+ getTextBoxFloatingGeometry as a2,
37594
+ getPresetPathSegments as a3,
37595
+ projectBlocksLayout as a4,
37596
+ textStyleToFontSizePt as a5,
37597
+ PX_PER_POINT$2 as a6,
37598
+ DEFAULT_FONT_SIZE_PX as a7,
37599
+ isDoubleUnderlineStyle as a8,
37600
+ isWavyUnderlineStyle as a9,
37601
+ formatFontSizePt as aA,
37602
+ listKindForTag as aB,
37603
+ isParagraphTag as aC,
37604
+ collectInlineRuns as aD,
37605
+ parseParagraphStyle as aE,
37606
+ t as aF,
37607
+ preciseFontModeVersion as aG,
37608
+ isPreciseFontModeEnabled as aH,
37609
+ togglePreciseFontMode as aI,
37610
+ nextFontSizePt as aJ,
37611
+ previousFontSizePt as aK,
37612
+ fontSizePtToPx as aL,
37613
+ createDefaultToolbarPreset as aM,
37614
+ defaultMenuItems as aN,
37615
+ MenuRegistry as aO,
37616
+ createToolbarRegistry as aP,
37617
+ Editor as aQ,
37618
+ resolveCommandRef as aR,
37619
+ commandRefName as aS,
37620
+ InlineShell as aT,
37621
+ BalloonShell as aU,
37622
+ DocumentShell as aV,
37623
+ createMemo as aW,
37624
+ getCaretRectFromSnapshot as aX,
37625
+ getParagraphRectFromSnapshot as aY,
37626
+ createComponent as aZ,
37627
+ CaretOverlay as a_,
37628
+ underlineStyleLineWidthPx as aa,
37629
+ underlineStyleDashArray as ab,
37630
+ getListLabelInset as ac,
37631
+ getParagraphBorderInsets as ad,
37632
+ normalizeFamily as ae,
37633
+ ROBOTO_FONT_FILES as af,
37634
+ loadFontAsset as ag,
37635
+ OFFICE_COMPAT_FONT_FAMILIES as ah,
37636
+ buildSfnt as ai,
37637
+ defaultFontDecoderRegistry as aj,
37638
+ SfntFontProgram as ak,
37639
+ collectPdfFontFamilies as al,
37640
+ projectDocumentLayout as am,
37641
+ getPageHeaderZoneTop as an,
37642
+ getPageBodyTop as ao,
37643
+ findFootnoteReference as ap,
37644
+ FOOTNOTE_MARKER_GUTTER_PX as aq,
37645
+ resolveImporterForFile as ar,
37646
+ createEditorStateFromDocument as as,
37647
+ getDocumentParagraphsCanonical as at,
37648
+ getToolbarStyleState as au,
37649
+ STANDARD_FONT_SIZES_PT as av,
37650
+ fontSizePxToPt as aw,
37651
+ probeLocalFontFamilies as ax,
37652
+ createInitialEditorState as ay,
37653
+ parseFontSizePtToPx as az,
37654
+ createEditorRun as b,
37655
+ RIBBON_TAB_DEFINITIONS as b$,
37656
+ createRenderEffect as b0,
37657
+ style as b1,
37658
+ setAttribute as b2,
37659
+ setStyleProperty as b3,
37660
+ memo as b4,
37661
+ template as b5,
37662
+ insert as b6,
37663
+ use as b7,
37664
+ addEventListener as b8,
37665
+ Dialog as b9,
37666
+ applyStoredPreciseFontPreference as bA,
37667
+ getWelcomeSeen as bB,
37668
+ isLocalFontAccessSupported as bC,
37669
+ EDITOR_SCROLL_PADDING_PX as bD,
37670
+ Toolbar as bE,
37671
+ OasisEditorLoading as bF,
37672
+ createEditorLogger as bG,
37673
+ getCachedCanvasImage as bH,
37674
+ registerDomStatsSurface as bI,
37675
+ Button as bJ,
37676
+ Checkbox as bK,
37677
+ ColorPicker as bL,
37678
+ CommandRegistry as bM,
37679
+ DEFAULT_PALETTE as bN,
37680
+ DialogFooter as bO,
37681
+ FloatingActionButton as bP,
37682
+ GridPicker as bQ,
37683
+ IconButton as bR,
37684
+ Menu as bS,
37685
+ OASIS_BUILTIN_COMMANDS as bT,
37686
+ OASIS_MENU_ITEMS as bU,
37687
+ OASIS_TOOLBAR_ITEMS as bV,
37688
+ OasisEditorAppLazy as bW,
37689
+ OasisEditorContainer as bX,
37690
+ PluginCollection as bY,
37691
+ Popover as bZ,
37692
+ RIBBON_TABS as b_,
37693
+ delegateEvents as ba,
37694
+ className as bb,
37695
+ For as bc,
37696
+ UNDERLINE_STYLE_OPTIONS as bd,
37697
+ Tabs as be,
37698
+ measureParagraphMinContentWidthPx as bf,
37699
+ getEditableBlocksForZone as bg,
37700
+ findParagraphLocation as bh,
37701
+ createSectionBoundaryParagraph as bi,
37702
+ normalizePageSettings as bj,
37703
+ DEFAULT_EDITOR_PAGE_SETTINGS as bk,
37704
+ markStart as bl,
37705
+ markEnd as bm,
37706
+ getParagraphEntries as bn,
37707
+ getParagraphById as bo,
37708
+ PluginUiHost as bp,
37709
+ OasisEditorEditor as bq,
37710
+ perfTimer as br,
37711
+ OasisBrandMark as bs,
37712
+ setPreciseFontPreference as bt,
37713
+ setWelcomeSeen as bu,
37714
+ enablePreciseFontMode as bv,
37715
+ createOasisEditorClient as bw,
37716
+ setLocale as bx,
37717
+ startLongTaskObserver as by,
37718
+ installGlobalReport as bz,
37407
37719
  createEditorParagraphFromRuns as c,
37408
- SidePanelFooter as c0,
37409
- SidePanelHeader as c1,
37410
- SplitButton as c2,
37411
- TextField as c3,
37412
- Button$1 as c4,
37413
- createEditorCommandBus as c5,
37414
- createOasisEditor as c6,
37415
- createOasisEditorContainer as c7,
37416
- mount as c8,
37417
- registerToolbarRenderer as c9,
37418
- getParagraphText as d,
37419
- getActiveZone as e,
37420
- getDocumentSections as f,
37720
+ Select as c0,
37721
+ SelectField as c1,
37722
+ Separator as c2,
37723
+ SidePanel as c3,
37724
+ SidePanelBody as c4,
37725
+ SidePanelFooter as c5,
37726
+ SidePanelHeader as c6,
37727
+ SplitButton as c7,
37728
+ TextField as c8,
37729
+ Button$1 as c9,
37730
+ createEditorCommandBus as ca,
37731
+ createOasisEditor as cb,
37732
+ createOasisEditorContainer as cc,
37733
+ mount as cd,
37734
+ registerToolbarRenderer as ce,
37735
+ getDocumentSections as d,
37736
+ createEditorStyledRun as e,
37737
+ getParagraphText as f,
37421
37738
  getParagraphs as g,
37422
- getActiveSectionIndex as h,
37423
- paragraphOffsetToPosition as i,
37424
- clampPosition as j,
37425
- findParagraphIndex as k,
37426
- createCollapsedSelection as l,
37427
- isSelectionCollapsed as m,
37739
+ getActiveZone as h,
37740
+ getActiveSectionIndex as i,
37741
+ paragraphOffsetToPosition as j,
37742
+ clampPosition as k,
37743
+ findParagraphIndex as l,
37744
+ createCollapsedSelection as m,
37428
37745
  normalizeSelection as n,
37429
- createEditorParagraph as o,
37746
+ isSelectionCollapsed as o,
37430
37747
  positionToParagraphOffset as p,
37431
- getBlockParagraphs as q,
37432
- findParagraphTableLocation as r,
37433
- buildTableCellLayout as s,
37434
- createEditorTableCell as t,
37435
- createEditorTable as u,
37436
- createEditorTableRow as v,
37437
- underlineStyleToCssDecorationStyle as w,
37438
- resolveImageSrc as x,
37439
- createEditorFootnote as y,
37440
- createFootnoteReferenceRun as z
37748
+ createEditorParagraph as q,
37749
+ getBlockParagraphs as r,
37750
+ findParagraphTableLocation as s,
37751
+ buildTableCellLayout as t,
37752
+ createEditorTableCell as u,
37753
+ createEditorTable as v,
37754
+ createEditorTableRow as w,
37755
+ underlineStyleToCssDecorationStyle as x,
37756
+ resolveImageSrc as y,
37757
+ createEditorFootnote as z
37441
37758
  };