oasis-editor 0.0.13 → 0.0.14

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.
@@ -1,7 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import { n as normalizeSelection, g as getParagraphs, c as createEditorParagraphFromRuns, a as getParagraphLength, b as createEditorRun, d as getDocumentSections, e as createEditorStyledRun, f as getParagraphText, h as getActiveZone, i as getActiveSectionIndex, p as positionToParagraphOffset, j as paragraphOffsetToPosition, k as clampPosition, l as findParagraphIndex, m as createCollapsedSelection, o as isSelectionCollapsed, q as createEditorParagraph, r as getBlockParagraphs, s as findParagraphTableLocation, t as buildTableCellLayout, u as createEditorTableCell, v as createEditorTable, w as createEditorTableRow, x as underlineStyleToCssDecorationStyle, y as resolveImageSrc, z as createEditorFootnote, A as createFootnoteReferenceRun, B as renumberFootnotes, C as iterateFootnoteReferenceRuns, D as getFootnoteDisplayMarker, E as createSignal, F as createEffect, G as onCleanup, H as buildCanvasLayoutSnapshot, I as on, J as onMount, K as debounce, L as unwrap, M as getDocumentParagraphs, N as getDocumentSectionsCanonical, O as createEditorDocument, P as getPageContentWidth, Q as getDocumentPageSettings, R as getTableCellContentWidthForParagraph, S as resolveResizedDimensions, T as resolveTextBoxRenderHeight, U as resolveEffectiveParagraphStyle, V as resolveEffectiveTextStyleForParagraph, W as iterateEndnoteReferenceRuns, X as JSZip, Y as imageContentTypeDefaults, Z as imageExtensionFromMime, _ as pxToPt$1, $ as buildSegmentTable, a0 as buildCanvasTableLayout, a1 as resolveFloatingObjectRect, a2 as getTextBoxFloatingGeometry, a3 as getPresetPathSegments, a4 as projectBlocksLayout, a5 as textStyleToFontSizePt, a6 as PX_PER_POINT, a7 as DEFAULT_FONT_SIZE_PX, a8 as isDoubleUnderlineStyle, a9 as isWavyUnderlineStyle, aa as underlineStyleLineWidthPx, ab as underlineStyleDashArray, ac as getListLabelInset, ad as getParagraphBorderInsets, ae as normalizeFamily, af as ROBOTO_FONT_FILES, ag as loadFontAsset, ah as OFFICE_COMPAT_FONT_FAMILIES, ai as buildSfnt, aj as defaultFontDecoderRegistry, ak as SfntFontProgram, al as collectPdfFontFamilies, am as projectDocumentLayout, an as getPageHeaderZoneTop, ao as getPageBodyTop, ap as findFootnoteReference, aq as FOOTNOTE_MARKER_GUTTER_PX, ar as resolveImporterForFile, as as createEditorStateFromDocument, at as getDocumentParagraphsCanonical, au as getToolbarStyleState, av as STANDARD_FONT_SIZES_PT, aw as fontSizePxToPt, ax as probeLocalFontFamilies, ay as createInitialEditorState, az as parseFontSizePtToPx, aA as formatFontSizePt, aB as listKindForTag, aC as isParagraphTag, aD as collectInlineRuns, aE as parseParagraphStyle, aF as t, aG as preciseFontModeVersion, aH as isPreciseFontModeEnabled, aI as togglePreciseFontMode, aJ as nextFontSizePt, aK as previousFontSizePt, aL as fontSizePtToPx, aM as createDefaultToolbarPreset, aN as defaultMenuItems, aO as MenuRegistry, aP as createToolbarRegistry, aQ as Editor, aR as resolveCommandRef, aS as commandRefName, aT as InlineShell, aU as BalloonShell, aV as DocumentShell, aW as createMemo, aX as getCaretRectFromSnapshot, aY as getParagraphRectFromSnapshot, aZ as createComponent, a_ as CaretOverlay, a$ as Show, b0 as createRenderEffect, b1 as style, b2 as setAttribute, b3 as setStyleProperty, b4 as memo, b5 as template, b6 as insert, b7 as use, b8 as addEventListener, b9 as Dialog, ba as delegateEvents, bb as className, bc as For, bd as UNDERLINE_STYLE_OPTIONS, be as Tabs, bf as measureParagraphMinContentWidthPx, bg as getEditableBlocksForZone, bh as findParagraphLocation, bi as createSectionBoundaryParagraph, bj as normalizePageSettings, bk as DEFAULT_EDITOR_PAGE_SETTINGS, bl as markStart, bm as markEnd, bn as getParagraphEntries, bo as getParagraphById, bp as PluginUiHost, bq as OasisEditorEditor, br as perfTimer, bs as OasisBrandMark, bt as setPreciseFontPreference, bu as setWelcomeSeen, bv as enablePreciseFontMode, bw as createOasisEditorClient, bx as setLocale, by as startLongTaskObserver, bz as installGlobalReport, bA as applyStoredPreciseFontPreference, bB as getWelcomeSeen, bC as isLocalFontAccessSupported, bD as EDITOR_SCROLL_PADDING_PX, bE as Toolbar, bF as OasisEditorLoading, bG as createEditorLogger, bH as getCachedCanvasImage, bI as registerDomStatsSurface } from "./index-CWev1Jg0.js";
4
+ import { n as normalizeSelection, g as getParagraphs, c as createEditorParagraphFromRuns, a as getParagraphLength, b as createEditorRun, d as getDocumentSections, e as createEditorStyledRun, f as getParagraphText, h as getActiveZone, i as getActiveSectionIndex, p as positionToParagraphOffset, j as paragraphOffsetToPosition, k as clampPosition, l as findParagraphIndex, m as createCollapsedSelection, o as isSelectionCollapsed, q as createEditorParagraph, r as getBlockParagraphs, s as findParagraphTableLocation, t as buildTableCellLayout, u as createEditorTableCell, v as createEditorTable, w as createEditorTableRow, x as underlineStyleToCssDecorationStyle, y as resolveImageSrc, z as createEditorFootnote, A as createFootnoteReferenceRun, B as renumberFootnotes, C as iterateFootnoteReferenceRuns, D as getFootnoteDisplayMarker, E as createSignal, F as createEffect, G as onCleanup, H as buildCanvasLayoutSnapshot, I as on, J as onMount, K as debounce, L as unwrap, M as getDocumentParagraphs, N as getDocumentSectionsCanonical, O as createEditorDocument, P as getPageContentWidth, Q as getDocumentPageSettings, R as getTableCellContentWidthForParagraph, S as resolveResizedDimensions, T as resolveTextBoxRenderHeight, U as resolveEffectiveParagraphStyle, V as resolveEffectiveTextStyleForParagraph, W as iterateEndnoteReferenceRuns, X as JSZip, Y as imageContentTypeDefaults, Z as imageExtensionFromMime, _ as pxToPt$1, $ as buildSegmentTable, a0 as buildCanvasTableLayout, a1 as resolveFloatingObjectRect, a2 as getTextBoxFloatingGeometry, a3 as getPresetPathSegments, a4 as projectBlocksLayout, a5 as textStyleToFontSizePt, a6 as PX_PER_POINT, a7 as DEFAULT_FONT_SIZE_PX, a8 as isDoubleUnderlineStyle, a9 as isWavyUnderlineStyle, aa as underlineStyleLineWidthPx, ab as underlineStyleDashArray, ac as getListLabelInset, ad as getParagraphBorderInsets, ae as normalizeFamily, af as ROBOTO_FONT_FILES, ag as loadFontAsset, ah as OFFICE_COMPAT_FONT_FAMILIES, ai as buildSfnt, aj as defaultFontDecoderRegistry, ak as SfntFontProgram, al as collectPdfFontFamilies, am as projectDocumentLayout, an as getPageHeaderZoneTop, ao as getPageBodyTop, ap as findFootnoteReference, aq as FOOTNOTE_MARKER_GUTTER_PX, ar as resolveImporterForFile, as as createEditorStateFromDocument, at as getDocumentParagraphsCanonical, au as getToolbarStyleState, av as STANDARD_FONT_SIZES_PT, aw as fontSizePxToPt, ax as probeLocalFontFamilies, ay as createInitialEditorState, az as parseFontSizePtToPx, aA as formatFontSizePt, aB as listKindForTag, aC as isParagraphTag, aD as collectInlineRuns, aE as parseParagraphStyle, aF as t, aG as preciseFontModeVersion, aH as isPreciseFontModeEnabled, aI as togglePreciseFontMode, aJ as nextFontSizePt, aK as previousFontSizePt, aL as fontSizePtToPx, aM as createDefaultToolbarPreset, aN as defaultMenuItems, aO as MenuRegistry, aP as createToolbarRegistry, aQ as Editor, aR as resolveCommandRef, aS as commandRefName, aT as InlineShell, aU as BalloonShell, aV as DocumentShell, aW as createMemo, aX as getCaretRectFromSnapshot, aY as getParagraphRectFromSnapshot, aZ as createComponent, a_ as CaretOverlay, a$ as Show, b0 as createRenderEffect, b1 as style, b2 as setAttribute, b3 as setStyleProperty, b4 as memo, b5 as template, b6 as insert, b7 as use, b8 as addEventListener, b9 as Dialog, ba as delegateEvents, bb as className, bc as For, bd as UNDERLINE_STYLE_OPTIONS, be as Tabs, bf as measureParagraphMinContentWidthPx, bg as getEditableBlocksForZone, bh as findParagraphLocation, bi as createSectionBoundaryParagraph, bj as normalizePageSettings, bk as DEFAULT_EDITOR_PAGE_SETTINGS, bl as markStart, bm as markEnd, bn as getParagraphEntries, bo as getParagraphById, bp as PluginUiHost, bq as OasisEditorEditor, br as perfTimer, bs as OasisBrandMark, bt as setPreciseFontPreference, bu as setWelcomeSeen, bv as enablePreciseFontMode, bw as createOasisEditorClient, bx as setLocale, by as startLongTaskObserver, bz as installGlobalReport, bA as applyStoredPreciseFontPreference, bB as getWelcomeSeen, bC as isLocalFontAccessSupported, bD as EDITOR_SCROLL_PADDING_PX, bE as Toolbar, bF as OasisEditorLoading, bG as createEditorLogger, bH as getCachedCanvasImage, bI as registerDomStatsSurface } from "./index-4CDpujGG.js";
5
5
  function getSelectedObjectRun(state, predicate) {
6
6
  const normalized = normalizeSelection(state);
7
7
  if (normalized.isCollapsed || normalized.startIndex !== normalized.endIndex || normalized.endParagraphOffset - normalized.startParagraphOffset !== 1) {
@@ -41131,6 +41131,25 @@ function buildParagraphAndSectionCommands({
41131
41131
  (p) => (paragraph.setIndentHanging(numOrNull(p)), true),
41132
41132
  () => s().indentHanging
41133
41133
  ),
41134
+ setSpecialIndent: actionCommand(
41135
+ "setSpecialIndent",
41136
+ (p) => {
41137
+ const payload = p ?? {};
41138
+ paragraph.setSpecialIndent(
41139
+ payload.kind ?? "none",
41140
+ numOrNull(payload.value)
41141
+ );
41142
+ },
41143
+ () => {
41144
+ const firstLine = Number(s().indentFirstLine);
41145
+ const hanging = Number(s().indentHanging);
41146
+ const kind = Number.isFinite(hanging) && hanging > 0 ? "hanging" : Number.isFinite(firstLine) && firstLine > 0 ? "firstLine" : "none";
41147
+ return {
41148
+ isActive: kind !== "none",
41149
+ value: kind
41150
+ };
41151
+ }
41152
+ ),
41134
41153
  setParagraphShading: valueCommand(
41135
41154
  "setParagraphShading",
41136
41155
  (p) => (paragraph.setShading(p ?? null), true),
@@ -41516,6 +41535,23 @@ function createEditorEssentialsRuntimePlugin(options) {
41516
41535
  "indentHanging",
41517
41536
  value
41518
41537
  ),
41538
+ setSpecialIndent: (kind, value) => {
41539
+ const resolvedValue = value ?? 48;
41540
+ options.applyTransactionalState(
41541
+ (current) => {
41542
+ let next = setParagraphStyle(current, "indentFirstLine", null);
41543
+ next = setParagraphStyle(next, "indentHanging", null);
41544
+ if (kind === "firstLine") {
41545
+ next = setParagraphStyle(next, "indentFirstLine", resolvedValue);
41546
+ } else if (kind === "hanging") {
41547
+ next = setParagraphStyle(next, "indentHanging", resolvedValue);
41548
+ }
41549
+ return next;
41550
+ },
41551
+ { mergeKey: "specialIndent" }
41552
+ );
41553
+ options.focusInput();
41554
+ },
41519
41555
  setShading: (value) => options.commandsController.applyParagraphStyleCommand("shading", value),
41520
41556
  applyBorders: () => {
41521
41557
  const border = {
@@ -1,2 +1,2 @@
1
- export declare const OASIS_BUILTIN_COMMANDS: readonly ["selectAll", "insertFootnote", "pastePlainText", "bold", "italic", "underline", "strike", "superscript", "subscript", "link", "unlink", "alignLeft", "alignCenter", "alignRight", "alignJustify", "orderedList", "bulletList", "find", "replace", "toggleTrackChanges", "acceptRevisions", "rejectRevisions", "toggleShowMargins", "toggleShowParagraphMarks", "togglePreciseFonts", "undo", "redo", "pageBreak", "lineBreak", "splitBlock", "setFontFamily", "setFontSize", "increaseFontSize", "decreaseFontSize", "changeTextCase", "clearFormatting", "setColor", "setHighlight", "setTextShading", "setStyleId", "setUnderlineStyle", "documentStyles", "print", "copy", "exportDocx", "exportPdf", "importDocument", "insertImage", "editImageAlt", "insertImageCaption", "outdent", "indent", "togglePageBreakBefore", "toggleKeepWithNext", "setSpacingAfter", "setSpacingBefore", "setIndentLeft", "setIndentRight", "setIndentFirstLine", "setIndentHanging", "setParagraphShading", "applyParagraphBorders", "setLineHeight", "setListFormat", "setListStartAt", "toggleOrientation", "sectionBreakNextPage", "sectionBreakContinuous", "setPageMargins", "tableContext", "tableMerge", "tableSplit", "tableInsertColumnBefore", "tableInsertColumnAfter", "tableDeleteColumn", "tableInsertRowBefore", "tableInsertRowAfter", "tableDeleteRow", "tableCellShading", "tableCellBorders", "tableCellNoBorders", "tableWidth100", "tableAlignLeft", "tableAlignCenter", "tableAlignRight", "tableSetCellWidth", "insertTable"];
1
+ export declare const OASIS_BUILTIN_COMMANDS: readonly ["selectAll", "insertFootnote", "pastePlainText", "bold", "italic", "underline", "strike", "superscript", "subscript", "link", "unlink", "alignLeft", "alignCenter", "alignRight", "alignJustify", "orderedList", "bulletList", "find", "replace", "toggleTrackChanges", "acceptRevisions", "rejectRevisions", "toggleShowMargins", "toggleShowParagraphMarks", "togglePreciseFonts", "undo", "redo", "pageBreak", "lineBreak", "splitBlock", "setFontFamily", "setFontSize", "increaseFontSize", "decreaseFontSize", "changeTextCase", "clearFormatting", "setColor", "setHighlight", "setTextShading", "setStyleId", "setUnderlineStyle", "documentStyles", "print", "copy", "exportDocx", "exportPdf", "importDocument", "insertImage", "editImageAlt", "insertImageCaption", "outdent", "indent", "togglePageBreakBefore", "toggleKeepWithNext", "setSpacingAfter", "setSpacingBefore", "setIndentLeft", "setIndentRight", "setIndentFirstLine", "setIndentHanging", "setSpecialIndent", "setParagraphShading", "applyParagraphBorders", "setLineHeight", "setListFormat", "setListStartAt", "toggleOrientation", "sectionBreakNextPage", "sectionBreakContinuous", "setPageMargins", "tableContext", "tableMerge", "tableSplit", "tableInsertColumnBefore", "tableInsertColumnAfter", "tableDeleteColumn", "tableInsertRowBefore", "tableInsertRowAfter", "tableDeleteRow", "tableCellShading", "tableCellBorders", "tableCellNoBorders", "tableWidth100", "tableAlignLeft", "tableAlignCenter", "tableAlignRight", "tableSetCellWidth", "insertTable"];
2
2
  export type OasisBuiltinCommand = (typeof OASIS_BUILTIN_COMMANDS)[number];
@@ -11,6 +11,10 @@ export interface SetFontSizePayload {
11
11
  }
12
12
  export interface SetPageMarginsPayload extends Partial<EditorPageMargins> {
13
13
  }
14
+ export interface SetSpecialIndentPayload {
15
+ kind: "none" | "firstLine" | "hanging";
16
+ value?: number | null;
17
+ }
14
18
  export interface OasisCommandPayloads {
15
19
  selectAll: undefined;
16
20
  insertFootnote: undefined;
@@ -72,6 +76,7 @@ export interface OasisCommandPayloads {
72
76
  setIndentRight: number | null;
73
77
  setIndentFirstLine: number | null;
74
78
  setIndentHanging: number | null;
79
+ setSpecialIndent: SetSpecialIndentPayload;
75
80
  setParagraphShading: string | null;
76
81
  applyParagraphBorders: undefined;
77
82
  setLineHeight: number | null;
@@ -42,6 +42,10 @@ export declare const en: {
42
42
  "toolbar.decreaseIndent": string;
43
43
  "toolbar.listFormat": string;
44
44
  "toolbar.listStartAt": string;
45
+ "toolbar.specialIndent": string;
46
+ "toolbar.specialIndentNone": string;
47
+ "toolbar.specialIndentFirstLine": string;
48
+ "toolbar.specialIndentHanging": string;
45
49
  "toolbar.formatDecimal": string;
46
50
  "toolbar.formatLowerLetter": string;
47
51
  "toolbar.formatUpperLetter": string;
@@ -42,6 +42,10 @@ export declare const ptBR: {
42
42
  "toolbar.decreaseIndent": string;
43
43
  "toolbar.listFormat": string;
44
44
  "toolbar.listStartAt": string;
45
+ "toolbar.specialIndent": string;
46
+ "toolbar.specialIndentNone": string;
47
+ "toolbar.specialIndentFirstLine": string;
48
+ "toolbar.specialIndentHanging": string;
45
49
  "toolbar.formatDecimal": string;
46
50
  "toolbar.formatLowerLetter": string;
47
51
  "toolbar.formatUpperLetter": string;
@@ -1458,6 +1458,10 @@ const en = {
1458
1458
  "toolbar.decreaseIndent": "Decrease indent (Shift+Tab)",
1459
1459
  "toolbar.listFormat": "Change list numbering format",
1460
1460
  "toolbar.listStartAt": "Start numbering at",
1461
+ "toolbar.specialIndent": "Special Indent",
1462
+ "toolbar.specialIndentNone": "None",
1463
+ "toolbar.specialIndentFirstLine": "First Line",
1464
+ "toolbar.specialIndentHanging": "Hanging",
1461
1465
  "toolbar.formatDecimal": "1, 2, 3",
1462
1466
  "toolbar.formatLowerLetter": "a, b, c",
1463
1467
  "toolbar.formatUpperLetter": "A, B, C",
@@ -1850,6 +1854,10 @@ const ptBR = {
1850
1854
  "toolbar.decreaseIndent": "Diminuir recuo (Shift+Tab)",
1851
1855
  "toolbar.listFormat": "Alterar formato de numeração",
1852
1856
  "toolbar.listStartAt": "Iniciar numeração em",
1857
+ "toolbar.specialIndent": "Recuo especial",
1858
+ "toolbar.specialIndentNone": "Nenhum",
1859
+ "toolbar.specialIndentFirstLine": "Primeira linha",
1860
+ "toolbar.specialIndentHanging": "Deslocamento",
1853
1861
  "toolbar.formatDecimal": "1, 2, 3",
1854
1862
  "toolbar.formatLowerLetter": "a, b, c",
1855
1863
  "toolbar.formatUpperLetter": "A, B, C",
@@ -2310,7 +2318,7 @@ function OasisEditorAppLazy(props = {}) {
2310
2318
  onCleanup(() => {
2311
2319
  cancelled = true;
2312
2320
  });
2313
- import("./OasisEditorApp-DYcAe_1n.js").then((m) => {
2321
+ import("./OasisEditorApp-BtRbOf8l.js").then((m) => {
2314
2322
  cancelled = true;
2315
2323
  setProgress(1);
2316
2324
  setTimeout(() => setApp(() => m.OasisEditorApp), 180);
@@ -4277,6 +4285,7 @@ const OASIS_BUILTIN_COMMANDS = [
4277
4285
  "setIndentRight",
4278
4286
  "setIndentFirstLine",
4279
4287
  "setIndentHanging",
4288
+ "setSpecialIndent",
4280
4289
  "setParagraphShading",
4281
4290
  "applyParagraphBorders",
4282
4291
  "setLineHeight",
@@ -4347,10 +4356,12 @@ class MenuRegistry {
4347
4356
  }
4348
4357
  }
4349
4358
  const defaultMenuRegistry = new MenuRegistry();
4350
- var _tmpl$$P = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg width=24 height=24 viewBox="0 0 24 24"fill=none aria-hidden=true><text x=2 y=18 font-family="'Segoe UI', Arial, sans-serif"font-size=14 font-weight=700 fill=currentColor>ab</text><text x=15.5 y=11 font-family="'Segoe UI', Arial, sans-serif"font-size=10 font-weight=700 fill=#c00000>1`), _tmpl$2$w = /* @__PURE__ */ template(`<i>`);
4359
+ var _tmpl$$P = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg width=24 height=24 viewBox="0 0 24 24"fill=none aria-hidden=true><text x=2 y=18 font-family="'Segoe UI', Arial, sans-serif"font-size=14 font-weight=700 fill=currentColor>ab</text><text x=15.5 y=11 font-family="'Segoe UI', Arial, sans-serif"font-size=10 font-weight=700 fill=#c00000>1`), _tmpl$2$w = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg width=24 height=24 viewBox="0 0 24 24"aria-hidden=true><g fill=currentColor><path d="M3.375 4.875 L7.125 8.625 L3.375 12.375 L2.25 11.25 L4.875 8.625 L2.25 6 Z"></path><rect x=10.125 y=6 width=9 height=1.6875 rx=0.25></rect><rect x=5.625 y=10.875 width=13.5 height=1.6875 rx=0.25></rect><rect x=5.625 y=15.75 width=13.5 height=1.6875 rx=0.25>`), _tmpl$3$k = /* @__PURE__ */ template(`<i>`);
4351
4360
  const FootnoteIcon = () => _tmpl$$P();
4361
+ const SpecialIndentFirstLineIcon = () => _tmpl$2$w();
4352
4362
  const CUSTOM_ICONS = {
4353
- footnote: FootnoteIcon
4363
+ footnote: FootnoteIcon,
4364
+ specialIndentFirstLine: SpecialIndentFirstLineIcon
4354
4365
  };
4355
4366
  function getCustomIcon(name) {
4356
4367
  return name ? CUSTOM_ICONS[name] : void 0;
@@ -4362,9 +4373,9 @@ function ToolIcon(props) {
4362
4373
  },
4363
4374
  get fallback() {
4364
4375
  return (() => {
4365
- var _el$2 = _tmpl$2$w();
4366
- createRenderEffect(() => setAttribute(_el$2, "data-lucide", props.name));
4367
- return _el$2;
4376
+ var _el$3 = _tmpl$3$k();
4377
+ createRenderEffect(() => setAttribute(_el$3, "data-lucide", props.name));
4378
+ return _el$3;
4368
4379
  })();
4369
4380
  },
4370
4381
  children: (render2) => render2()()
@@ -4691,7 +4702,7 @@ const defaultMenuItems = [
4691
4702
  }
4692
4703
  ];
4693
4704
  defaultMenuItems.forEach((item) => defaultMenuRegistry.register(item));
4694
- var _tmpl$$O = /* @__PURE__ */ template(`<div class=oasis-menubar role=menubar>`), _tmpl$2$v = /* @__PURE__ */ template(`<div class=oasis-menubar-dropdown role=menu>`), _tmpl$3$k = /* @__PURE__ */ template(`<div class=oasis-menubar-menu><div class=oasis-menubar-button role=menuitem aria-haspopup=true>`), _tmpl$4$e = /* @__PURE__ */ template(`<div class=oasis-menubar-separator role=separator>`), _tmpl$5$d = /* @__PURE__ */ template(`<span class=oasis-menubar-item-icon aria-hidden=true>`), _tmpl$6$6 = /* @__PURE__ */ template(`<span class=oasis-menubar-shortcut>`), _tmpl$7$3 = /* @__PURE__ */ template(`<i class=oasis-menubar-submenu-icon data-lucide=chevron-right>`), _tmpl$8$2 = /* @__PURE__ */ template(`<div class=oasis-menubar-submenu role=menu>`), _tmpl$9$1 = /* @__PURE__ */ template(`<div class=oasis-menubar-item role=menuitem><span class=oasis-menubar-item-main><span>`);
4705
+ var _tmpl$$O = /* @__PURE__ */ template(`<div class=oasis-menubar role=menubar>`), _tmpl$2$v = /* @__PURE__ */ template(`<div class=oasis-menubar-dropdown role=menu>`), _tmpl$3$j = /* @__PURE__ */ template(`<div class=oasis-menubar-menu><div class=oasis-menubar-button role=menuitem aria-haspopup=true>`), _tmpl$4$e = /* @__PURE__ */ template(`<div class=oasis-menubar-separator role=separator>`), _tmpl$5$d = /* @__PURE__ */ template(`<span class=oasis-menubar-item-icon aria-hidden=true>`), _tmpl$6$6 = /* @__PURE__ */ template(`<span class=oasis-menubar-shortcut>`), _tmpl$7$3 = /* @__PURE__ */ template(`<i class=oasis-menubar-submenu-icon data-lucide=chevron-right>`), _tmpl$8$2 = /* @__PURE__ */ template(`<div class=oasis-menubar-submenu role=menu>`), _tmpl$9$1 = /* @__PURE__ */ template(`<div class=oasis-menubar-item role=menuitem><span class=oasis-menubar-item-main><span>`);
4695
4706
  function Menubar(props) {
4696
4707
  const [activeMenu, setActiveMenu] = createSignal(null);
4697
4708
  const menuItems = () => (props.registry ?? defaultMenuRegistry).getItems();
@@ -4764,7 +4775,7 @@ function Menubar(props) {
4764
4775
  return topLevelItems();
4765
4776
  },
4766
4777
  children: (topLevel) => (() => {
4767
- var _el$2 = _tmpl$3$k(), _el$3 = _el$2.firstChild;
4778
+ var _el$2 = _tmpl$3$j(), _el$3 = _el$2.firstChild;
4768
4779
  _el$2.addEventListener("mouseenter", () => {
4769
4780
  if (activeMenu() && activeMenu() !== topLevel.id) {
4770
4781
  setActiveMenu(topLevel.id);
@@ -16880,7 +16891,7 @@ function getCaretRectFromSnapshot(snapshot, position2, paragraphOffset) {
16880
16891
  );
16881
16892
  return rectFromBox(slot.left, slot.top, 1, slot.height || line.height);
16882
16893
  }
16883
- var _tmpl$$M = /* @__PURE__ */ template(`<span class=oasis-outline-title>`), _tmpl$2$u = /* @__PURE__ */ template(`<div class=oasis-outline-list>`), _tmpl$3$j = /* @__PURE__ */ template(`<div class=oasis-outline-panel><div class=oasis-outline-header><button class=oasis-outline-toggle><i>`), _tmpl$4$d = /* @__PURE__ */ template(`<div class=oasis-outline-empty>`), _tmpl$5$c = /* @__PURE__ */ template(`<div class=oasis-outline-item>`);
16894
+ var _tmpl$$M = /* @__PURE__ */ template(`<span class=oasis-outline-title>`), _tmpl$2$u = /* @__PURE__ */ template(`<div class=oasis-outline-list>`), _tmpl$3$i = /* @__PURE__ */ template(`<div class=oasis-outline-panel><div class=oasis-outline-header><button class=oasis-outline-toggle><i>`), _tmpl$4$d = /* @__PURE__ */ template(`<div class=oasis-outline-empty>`), _tmpl$5$c = /* @__PURE__ */ template(`<div class=oasis-outline-item>`);
16884
16895
  function OutlinePanel(props) {
16885
16896
  const [collapsed, setCollapsed] = createSignal(props.defaultCollapsed ?? false);
16886
16897
  const [items, setItems] = createSignal([]);
@@ -16948,7 +16959,7 @@ function OutlinePanel(props) {
16948
16959
  }
16949
16960
  });
16950
16961
  return (() => {
16951
- var _el$ = _tmpl$3$j(), _el$2 = _el$.firstChild, _el$4 = _el$2.firstChild, _el$5 = _el$4.firstChild;
16962
+ var _el$ = _tmpl$3$i(), _el$2 = _el$.firstChild, _el$4 = _el$2.firstChild, _el$5 = _el$4.firstChild;
16952
16963
  insert(_el$2, createComponent(Show, {
16953
16964
  get when() {
16954
16965
  return !collapsed();
@@ -17445,7 +17456,7 @@ function Popover(props) {
17445
17456
  }
17446
17457
  })];
17447
17458
  }
17448
- var _tmpl$$I = /* @__PURE__ */ template(`<div>`), _tmpl$2$r = /* @__PURE__ */ template(`<div class=oasis-editor-toolbar-dropdown>`), _tmpl$3$i = /* @__PURE__ */ template(`<i>`), _tmpl$4$c = /* @__PURE__ */ template(`<span class=oasis-editor-tool-button-label>`), _tmpl$5$b = /* @__PURE__ */ template(`<i data-lucide=chevron-down class=oasis-editor-dropdown-chevron>`), _tmpl$6$5 = /* @__PURE__ */ template(`<button type=button class="oasis-editor-tool-button oasis-editor-tool-button-dropdown"aria-haspopup=menu>`);
17459
+ var _tmpl$$I = /* @__PURE__ */ template(`<div>`), _tmpl$2$r = /* @__PURE__ */ template(`<div class=oasis-editor-toolbar-dropdown>`), _tmpl$3$h = /* @__PURE__ */ template(`<i>`), _tmpl$4$c = /* @__PURE__ */ template(`<span class=oasis-editor-tool-button-label>`), _tmpl$5$b = /* @__PURE__ */ template(`<i data-lucide=chevron-down class=oasis-editor-dropdown-chevron>`), _tmpl$6$5 = /* @__PURE__ */ template(`<button type=button class="oasis-editor-tool-button oasis-editor-tool-button-dropdown"aria-haspopup=menu>`);
17449
17460
  function Menu(props) {
17450
17461
  const [open, setOpen] = createSignal(false);
17451
17462
  const ariaLabel = () => props.tooltip || props.label || "";
@@ -17473,7 +17484,7 @@ function Menu(props) {
17473
17484
  return props.icon;
17474
17485
  },
17475
17486
  get children() {
17476
- var _el$4 = _tmpl$3$i();
17487
+ var _el$4 = _tmpl$3$h();
17477
17488
  createRenderEffect(() => setAttribute(_el$4, "data-lucide", props.icon));
17478
17489
  return _el$4;
17479
17490
  }
@@ -17639,7 +17650,7 @@ function SplitButton(props) {
17639
17650
  });
17640
17651
  }
17641
17652
  delegateEvents(["click"]);
17642
- var _tmpl$$E = /* @__PURE__ */ template(`<i data-lucide=type>`), _tmpl$2$q = /* @__PURE__ */ template(`<button type=button class=oasis-editor-color-menu-action role=menuitem><span class=oasis-editor-color-menu-action-swatch></span><span>`), _tmpl$3$h = /* @__PURE__ */ template(`<div class=oasis-editor-color-menu-section><div class=oasis-editor-color-menu-heading></div><div class=oasis-editor-color-theme-grid>`), _tmpl$4$b = /* @__PURE__ */ template(`<div class=oasis-editor-color-menu-section><div class=oasis-editor-color-menu-heading></div><div class=oasis-editor-color-standard-grid>`), _tmpl$5$a = /* @__PURE__ */ template(`<button type=button class=oasis-editor-color-menu-action role=menuitem><span class="oasis-editor-color-menu-action-swatch oasis-editor-color-menu-more-swatch"></span><span>`), _tmpl$6$4 = /* @__PURE__ */ template(`<input type=color class=oasis-editor-color-custom-input>`), _tmpl$7$2 = /* @__PURE__ */ template(`<span class=oasis-editor-color-split-icon><i></i><span class=oasis-editor-color-split-indicator>`), _tmpl$8$1 = /* @__PURE__ */ template(`<i data-lucide=slash>`), _tmpl$9 = /* @__PURE__ */ template(`<div class=oasis-editor-color-theme-column>`), _tmpl$0 = /* @__PURE__ */ template(`<button type=button class=oasis-editor-color-swatch>`);
17653
+ var _tmpl$$E = /* @__PURE__ */ template(`<i data-lucide=type>`), _tmpl$2$q = /* @__PURE__ */ template(`<button type=button class=oasis-editor-color-menu-action role=menuitem><span class=oasis-editor-color-menu-action-swatch></span><span>`), _tmpl$3$g = /* @__PURE__ */ template(`<div class=oasis-editor-color-menu-section><div class=oasis-editor-color-menu-heading></div><div class=oasis-editor-color-theme-grid>`), _tmpl$4$b = /* @__PURE__ */ template(`<div class=oasis-editor-color-menu-section><div class=oasis-editor-color-menu-heading></div><div class=oasis-editor-color-standard-grid>`), _tmpl$5$a = /* @__PURE__ */ template(`<button type=button class=oasis-editor-color-menu-action role=menuitem><span class="oasis-editor-color-menu-action-swatch oasis-editor-color-menu-more-swatch"></span><span>`), _tmpl$6$4 = /* @__PURE__ */ template(`<input type=color class=oasis-editor-color-custom-input>`), _tmpl$7$2 = /* @__PURE__ */ template(`<span class=oasis-editor-color-split-icon><i></i><span class=oasis-editor-color-split-indicator>`), _tmpl$8$1 = /* @__PURE__ */ template(`<i data-lucide=slash>`), _tmpl$9 = /* @__PURE__ */ template(`<div class=oasis-editor-color-theme-column>`), _tmpl$0 = /* @__PURE__ */ template(`<button type=button class=oasis-editor-color-swatch>`);
17643
17654
  const normalizeColor = (value) => (value == null ? void 0 : value.trim().toLowerCase()) ?? "";
17644
17655
  function ColorPicker(props) {
17645
17656
  const [isOpen, setIsOpen] = createSignal(false);
@@ -17722,7 +17733,7 @@ function ColorPicker(props) {
17722
17733
  return _el$;
17723
17734
  }
17724
17735
  }), (() => {
17725
- var _el$5 = _tmpl$3$h(), _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling;
17736
+ var _el$5 = _tmpl$3$g(), _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling;
17726
17737
  insert(_el$6, () => props.themeColorsLabel);
17727
17738
  insert(_el$7, createComponent(For, {
17728
17739
  get each() {
@@ -17827,7 +17838,7 @@ function ColorPicker(props) {
17827
17838
  });
17828
17839
  }
17829
17840
  delegateEvents(["click", "input"]);
17830
- var _tmpl$$D = /* @__PURE__ */ template(`<div class=oasis-editor-table-grid-picker-status>`), _tmpl$2$p = /* @__PURE__ */ template(`<div class=oasis-editor-table-grid-picker-grid>`), _tmpl$3$g = /* @__PURE__ */ template(`<div class=oasis-editor-toolbar-dropdown>`), _tmpl$4$a = /* @__PURE__ */ template(`<button type=button class=oasis-editor-tool-button><i>`), _tmpl$5$9 = /* @__PURE__ */ template(`<button type=button class=oasis-editor-table-grid-picker-cell>`);
17841
+ var _tmpl$$D = /* @__PURE__ */ template(`<div class=oasis-editor-table-grid-picker-status>`), _tmpl$2$p = /* @__PURE__ */ template(`<div class=oasis-editor-table-grid-picker-grid>`), _tmpl$3$f = /* @__PURE__ */ template(`<div class=oasis-editor-toolbar-dropdown>`), _tmpl$4$a = /* @__PURE__ */ template(`<button type=button class=oasis-editor-tool-button><i>`), _tmpl$5$9 = /* @__PURE__ */ template(`<button type=button class=oasis-editor-table-grid-picker-cell>`);
17831
17842
  function GridPicker(props) {
17832
17843
  const [isOpen, setIsOpen] = createSignal(false);
17833
17844
  const [hover, setHover] = createSignal({
@@ -17901,7 +17912,7 @@ function GridPicker(props) {
17901
17912
  return h.row === 0 || h.col === 0 ? t("toolbar.table") : `${h.row} × ${h.col}`;
17902
17913
  };
17903
17914
  return (() => {
17904
- var _el$ = _tmpl$3$g();
17915
+ var _el$ = _tmpl$3$f();
17905
17916
  insert(_el$, createComponent(Popover, {
17906
17917
  get open() {
17907
17918
  return isOpen();
@@ -18039,7 +18050,7 @@ const DEFAULT_PALETTE = {
18039
18050
  standardColors: STANDARD_COLORS,
18040
18051
  allowCustom: true
18041
18052
  };
18042
- var _tmpl$$C = /* @__PURE__ */ template(`<i>`), _tmpl$2$o = /* @__PURE__ */ template(`<option value>`), _tmpl$3$f = /* @__PURE__ */ template(`<option>`);
18053
+ var _tmpl$$C = /* @__PURE__ */ template(`<option value>`), _tmpl$2$o = /* @__PURE__ */ template(`<option>`);
18043
18054
  function renderMenuContent(content, api) {
18044
18055
  if (content.kind === "custom") {
18045
18056
  return content.render(api);
@@ -18167,14 +18178,16 @@ function RenderSplit(props) {
18167
18178
  get menuTestId() {
18168
18179
  return memo(() => !!props.item.testId)() ? `${props.item.testId}-dropdown` : void 0;
18169
18180
  },
18170
- panelClass: "oasis-editor-color-menu",
18181
+ get panelClass() {
18182
+ return props.item.panelClass ?? "oasis-editor-color-menu";
18183
+ },
18171
18184
  panelRole: "menu",
18172
18185
  get mainContent() {
18173
- return (() => {
18174
- var _el$ = _tmpl$$C();
18175
- createRenderEffect(() => setAttribute(_el$, "data-lucide", props.item.iconName));
18176
- return _el$;
18177
- })();
18186
+ return memo(() => !!props.item.iconName)() ? createComponent(ToolIcon, {
18187
+ get name() {
18188
+ return props.item.iconName;
18189
+ }
18190
+ }) : [];
18178
18191
  },
18179
18192
  get children() {
18180
18193
  return renderMenuContent(props.item.menu, props.api);
@@ -18210,19 +18223,19 @@ function RenderSelect(props) {
18210
18223
  return props.item.placeholder !== void 0;
18211
18224
  },
18212
18225
  get children() {
18213
- var _el$2 = _tmpl$2$o();
18214
- insert(_el$2, () => props.item.placeholder);
18215
- return _el$2;
18226
+ var _el$ = _tmpl$$C();
18227
+ insert(_el$, () => props.item.placeholder);
18228
+ return _el$;
18216
18229
  }
18217
18230
  }), createComponent(For, {
18218
18231
  get each() {
18219
18232
  return props.item.options(props.api);
18220
18233
  },
18221
18234
  children: (option) => (() => {
18222
- var _el$3 = _tmpl$3$f();
18223
- insert(_el$3, () => option.label);
18224
- createRenderEffect(() => _el$3.value = option.value);
18225
- return _el$3;
18235
+ var _el$2 = _tmpl$2$o();
18236
+ insert(_el$2, () => option.label);
18237
+ createRenderEffect(() => _el$2.value = option.value);
18238
+ return _el$2;
18226
18239
  })()
18227
18240
  })];
18228
18241
  }
@@ -37367,6 +37380,11 @@ const RIBBON_PLACEMENTS = {
37367
37380
  "editor-toolbar-list-outdent": { tab: "home", group: "paragraph", row: 1 },
37368
37381
  "editor-toolbar-list-indent": { tab: "home", group: "paragraph", row: 1 },
37369
37382
  "editor-toolbar-list-options": { tab: "home", group: "paragraph", row: 1 },
37383
+ "editor-toolbar-special-indent": {
37384
+ tab: "home",
37385
+ group: "paragraph",
37386
+ row: 1
37387
+ },
37370
37388
  "editor-toolbar-line-spacing-control": {
37371
37389
  tab: "home",
37372
37390
  group: "paragraph",
@@ -37808,6 +37826,54 @@ function createDefaultToolbarPreset() {
37808
37826
  id: "editor-toolbar-list-options",
37809
37827
  render: (api) => ListOptionsControl({ api })
37810
37828
  });
37829
+ items.push({
37830
+ type: "split",
37831
+ id: "editor-toolbar-special-indent",
37832
+ testId: "editor-toolbar-special-indent",
37833
+ iconName: "specialIndentFirstLine",
37834
+ tooltipKey: "toolbar.specialIndent",
37835
+ command: { name: "setSpecialIndent", payload: { kind: "firstLine" } },
37836
+ isActive: () => false,
37837
+ panelClass: "oasis-editor-toolbar-dropdown-menu oasis-editor-special-indent-menu",
37838
+ menu: {
37839
+ kind: "items",
37840
+ items: [
37841
+ {
37842
+ type: "button",
37843
+ id: "editor-toolbar-special-indent-none",
37844
+ testId: "editor-toolbar-special-indent-none",
37845
+ iconName: "minus",
37846
+ labelKey: "toolbar.specialIndentNone",
37847
+ tooltipKey: "toolbar.specialIndentNone",
37848
+ command: { name: "setSpecialIndent", payload: { kind: "none" } },
37849
+ wide: true
37850
+ },
37851
+ {
37852
+ type: "button",
37853
+ id: "editor-toolbar-special-indent-first-line",
37854
+ testId: "editor-toolbar-special-indent-first-line",
37855
+ iconName: "list-collapse",
37856
+ labelKey: "toolbar.specialIndentFirstLine",
37857
+ tooltipKey: "toolbar.specialIndentFirstLine",
37858
+ command: {
37859
+ name: "setSpecialIndent",
37860
+ payload: { kind: "firstLine" }
37861
+ },
37862
+ wide: true
37863
+ },
37864
+ {
37865
+ type: "button",
37866
+ id: "editor-toolbar-special-indent-hanging",
37867
+ testId: "editor-toolbar-special-indent-hanging",
37868
+ iconName: "list-indent-increase",
37869
+ labelKey: "toolbar.specialIndentHanging",
37870
+ tooltipKey: "toolbar.specialIndentHanging",
37871
+ command: { name: "setSpecialIndent", payload: { kind: "hanging" } },
37872
+ wide: true
37873
+ }
37874
+ ]
37875
+ }
37876
+ });
37811
37877
  items.push({
37812
37878
  type: "custom",
37813
37879
  id: "editor-toolbar-line-spacing-control",
@@ -37873,6 +37939,7 @@ const OASIS_TOOLBAR_ITEMS = {
37873
37939
  outdent: "editor-toolbar-list-outdent",
37874
37940
  indent: "editor-toolbar-list-indent",
37875
37941
  listOptions: "editor-toolbar-list-options",
37942
+ specialIndent: "editor-toolbar-special-indent",
37876
37943
  lineSpacing: "editor-toolbar-line-spacing-control",
37877
37944
  metrics: "editor-toolbar-metrics",
37878
37945
  table: "editor-toolbar-table",
package/dist/index.d.ts CHANGED
@@ -15,7 +15,7 @@ export { commandRefName, resolveCommandRef, } from './core/commands/CommandRef.j
15
15
  export { createEditorCommandBus } from './core/commands/CommandBus.js';
16
16
  export { OASIS_BUILTIN_COMMANDS } from './core/commands/builtinCommands.js';
17
17
  export type { OasisBuiltinCommand } from './core/commands/builtinCommands.js';
18
- export type { CommandPayloadArgs, InsertTablePayload, OasisCommandName, OasisCommandPayloads, OasisCommandResults, SetFontSizePayload, SetPageMarginsPayload, TypedCommandBus, } from './core/commands/publicCommandTypes.js';
18
+ export type { CommandPayloadArgs, InsertTablePayload, OasisCommandName, OasisCommandPayloads, OasisCommandResults, SetFontSizePayload, SetPageMarginsPayload, SetSpecialIndentPayload, TypedCommandBus, } from './core/commands/publicCommandTypes.js';
19
19
  export { PluginCollection } from './core/plugins/PluginCollection.js';
20
20
  export { mount } from './ui/mount.js';
21
21
  export { DocumentShell } from './ui/shells/DocumentShell.js';
@@ -1,4 +1,4 @@
1
- import { aU, bJ, bK, bL, bM, bN, b9, bO, aV, aQ, bP, bQ, bR, aT, bS, aO, bT, bU, bV, bW, bX, bF, bY, bZ, b_, b$, c0, c1, c2, c3, c4, c5, c6, c7, be, c8, bE, c9, bL as bL2, bQ as bQ2, bS as bS2, c0 as c02, c2 as c22, c7 as c72, aS, aM, ca, cb, cc, aP, cd, ce, aR } from "./index-CWev1Jg0.js";
1
+ import { aU, bJ, bK, bL, bM, bN, b9, bO, aV, aQ, bP, bQ, bR, aT, bS, aO, bT, bU, bV, bW, bX, bF, bY, bZ, b_, b$, c0, c1, c2, c3, c4, c5, c6, c7, be, c8, bE, c9, bL as bL2, bQ as bQ2, bS as bS2, c0 as c02, c2 as c22, c7 as c72, aS, aM, ca, cb, cc, aP, cd, ce, aR } from "./index-4CDpujGG.js";
2
2
  export {
3
3
  aU as BalloonShell,
4
4
  bJ as Button,