oasis-editor 0.0.31 → 0.0.32

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,6 +1,12 @@
1
1
  import { EditorAsset, EditorBlockNode, EditorDocument, EditorFootnote, EditorPageSettings, EditorParagraphNode, EditorSection, EditorState, EditorTableCellNode, EditorTableNode, EditorTableRowNode, EditorTextRun, EditorTextStyle, EditorTextBoxData, EditorImageRunData, EditorNamedStyle } from './model.js';
2
2
 
3
- export declare function resetEditorIds(): void;
3
+ export type EditorNodeKind = "document" | "paragraph" | "run" | "table" | "table-row" | "table-cell" | "footnote" | "bookmark" | "comment";
4
+ /**
5
+ * Single authority for editor node IDs. Stateless and globally unique, so two
6
+ * editors mounted on the same page never share a sequence. The `kind` prefix is
7
+ * kept purely for debuggability; no code parses it for ordering or numbering.
8
+ */
9
+ export declare function createEditorNodeId(kind: EditorNodeKind): string;
4
10
  export declare function createEditorBookmarkId(): string;
5
11
  export declare function createEditorCommentId(): string;
6
12
  export declare function createEditorRun(text?: string): EditorTextRun;
@@ -1,7 +1,5 @@
1
1
  import { EditorBlockNode, EditorDocument, EditorEndnote, EditorEndnotes, EditorParagraphNode, EditorTextRun } from './model.js';
2
2
 
3
- export declare function resetEndnoteIds(): void;
4
- export declare function createEndnoteId(): string;
5
3
  /**
6
4
  * Iterate every paragraph in document order (endnote bodies excluded), yielding
7
5
  * each endnote reference run with its owning paragraph. Order matches reading
@@ -1,7 +1,5 @@
1
1
  import { EditorBlockNode, EditorDocument, EditorFootnote, EditorFootnoteNumberFormat, EditorFootnotes, EditorParagraphNode, EditorTextRun } from './model.js';
2
2
 
3
- export declare function resetFootnoteIds(): void;
4
- export declare function createFootnoteId(): string;
5
3
  /**
6
4
  * Iterate every paragraph in document order (sections + footnotes excluded),
7
5
  * yielding each footnote reference run along with the owning paragraph. Order
@@ -0,0 +1,9 @@
1
+ import { JSX } from 'solid-js';
2
+ import { TranslateFn } from './index.js';
3
+
4
+ /** Access the translator from the nearest `I18nProvider`. */
5
+ export declare function useI18n(): TranslateFn;
6
+ export declare function I18nProvider(props: {
7
+ translator: TranslateFn;
8
+ children: JSX.Element;
9
+ }): JSX.Element;
@@ -2,6 +2,10 @@ import { en } from './locales/en.js';
2
2
 
3
3
  export type Locale = "en" | "pt-BR";
4
4
  export type TranslationKey = keyof typeof en;
5
- export declare function setLocale(locale: Locale): void;
6
- export declare function getLocale(): Locale;
7
- export declare function t(key: TranslationKey, params?: unknown[]): string;
5
+ export type TranslateFn = (key: TranslationKey, params?: unknown[]) => string;
6
+ /**
7
+ * Build a translator bound to a locale accessor. The accessor is read on every
8
+ * call, so when it reads a Solid signal the translation tracks locale changes
9
+ * reactively. No module-level mutable locale is involved.
10
+ */
11
+ export declare function createTranslator(getLocale: () => Locale): TranslateFn;