@clepit/core 0.3.0 → 0.4.0-beta.340

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,5 +1,5 @@
1
1
  export declare const inputStylesKey = "clepit-checklist-input-styles";
2
2
  export declare const inputStyle: string;
3
3
  export declare const outputStylesKey = "clepit-checklist-output-styles";
4
- export declare const outputStyle = "\n/* Checklist output block styles */\n.clepit-output-checklist {\n margin: 0 0 1rem 0;\n padding-left: 0;\n}\n\n.clepit-output-checklist-item {\n --text: var(--clepit-text);\n --check: var(--clepit-marker);\n --disabled: var(--clepit-border);\n --border-radius: 10px;\n border-radius: var(--border-radius);\n position: relative;\n padding: 5px;\n display: grid;\n grid-template-columns: 30px auto;\n align-items: center;\n margin: 0.5rem 0;\n line-height: 1.6;\n}\n\n.clepit-output-checklist-text {\n color: var(--text);\n position: relative;\n cursor: pointer;\n display: grid;\n align-items: center;\n width: -webkit-fit-content;\n width: -moz-fit-content;\n width: fit-content;\n transition: color 0.3s ease;\n line-height: 1.6;\n}\n\n.clepit-output-checklist-text::before,\n.clepit-output-checklist-text::after {\n content: \"\";\n position: absolute;\n}\n\n.clepit-output-checklist-text::before {\n height: 2px;\n width: 8px;\n left: -27px;\n background: var(--check);\n border-radius: 2px;\n transition: background 0.3s ease;\n}\n\n.clepit-output-checklist-text::after {\n height: 4px;\n width: 4px;\n top: 8px;\n left: -25px;\n border-radius: 50%;\n}\n\n.clepit-output-checklist-checkbox {\n -webkit-appearance: none;\n -moz-appearance: none;\n position: relative;\n height: 15px;\n width: 15px;\n outline: none;\n border: 0;\n margin: 0 15px 0 0;\n cursor: pointer;\n background: var(--background);\n display: grid;\n align-items: center;\n pointer-events: none;\n}\n\n.clepit-output-checklist-checkbox::before,\n.clepit-output-checklist-checkbox::after {\n content: \"\";\n position: absolute;\n height: 2px;\n top: auto;\n background: var(--check);\n border-radius: 2px;\n}\n\n.clepit-output-checklist-checkbox::before {\n width: 0px;\n right: 60%;\n transform-origin: right bottom;\n}\n\n.clepit-output-checklist-checkbox::after {\n width: 0px;\n left: 40%;\n transform-origin: left bottom;\n}\n\n.clepit-output-checklist-checkbox:checked::before {\n -webkit-animation: clepit-check-01-11 0.4s ease forwards;\n animation: clepit-check-01-11 0.4s ease forwards;\n}\n\n.clepit-output-checklist-checkbox:checked::after {\n -webkit-animation: clepit-check-02-11 0.4s ease forwards;\n animation: clepit-check-02-11 0.4s ease forwards;\n}\n\n.clepit-output-checklist-checkbox:checked + .clepit-output-checklist-text {\n color: var(--disabled);\n -webkit-animation: clepit-move-11 0.3s ease 0.1s forwards;\n animation: clepit-move-11 0.3s ease 0.1s forwards;\n}\n\n.clepit-output-checklist-checkbox:checked + .clepit-output-checklist-text::before {\n background: var(--disabled);\n -webkit-animation: clepit-slice-11 0.4s ease forwards;\n animation: clepit-slice-11 0.4s ease forwards;\n}\n\n.clepit-output-checklist-checkbox:checked + .clepit-output-checklist-text::after {\n -webkit-animation: clepit-firework-11 0.5s ease forwards 0.1s;\n animation: clepit-firework-11 0.5s ease forwards 0.1s;\n}\n\n@-webkit-keyframes clepit-move-11 {\n 50% {\n padding-left: 8px;\n padding-right: 0px;\n }\n 100% {\n padding-right: 4px;\n }\n}\n\n@keyframes clepit-move-11 {\n 50% {\n padding-left: 8px;\n padding-right: 0px;\n }\n 100% {\n padding-right: 4px;\n }\n}\n\n@-webkit-keyframes clepit-slice-11 {\n 60% {\n width: 100%;\n left: 4px;\n }\n 100% {\n width: 100%;\n left: -2px;\n padding-left: 0;\n }\n}\n\n@keyframes clepit-slice-11 {\n 60% {\n width: 100%;\n left: 4px;\n }\n 100% {\n width: 100%;\n left: -2px;\n padding-left: 0;\n }\n}\n\n@-webkit-keyframes clepit-check-01-11 {\n 0% {\n width: 4px;\n top: auto;\n transform: rotate(0);\n }\n 50% {\n width: 0px;\n top: auto;\n transform: rotate(0);\n }\n 51% {\n width: 0px;\n top: 8px;\n transform: rotate(45deg);\n }\n 100% {\n width: 5px;\n top: 8px;\n transform: rotate(45deg);\n }\n}\n\n@keyframes clepit-check-01-11 {\n 0% {\n width: 4px;\n top: auto;\n transform: rotate(0);\n }\n 50% {\n width: 0px;\n top: auto;\n transform: rotate(0);\n }\n 51% {\n width: 0px;\n top: 8px;\n transform: rotate(45deg);\n }\n 100% {\n width: 5px;\n top: 8px;\n transform: rotate(45deg);\n }\n}\n\n@-webkit-keyframes clepit-check-02-11 {\n 0% {\n width: 4px;\n top: 17px;\n transform: rotate(0);\n }\n 50% {\n width: 0px;\n top: 17px;\n transform: rotate(0);\n }\n 51% {\n width: 0px;\n top: 8px;\n transform: rotate(-45deg);\n }\n 100% {\n width: 10px;\n top: 8px;\n transform: rotate(-45deg);\n }\n}\n\n@keyframes clepit-check-02-11 {\n 0% {\n width: 4px;\n top: 17px;\n transform: rotate(0);\n }\n 50% {\n width: 0px;\n top: 17px;\n transform: rotate(0);\n }\n 51% {\n width: 0px;\n top: 8px;\n transform: rotate(-45deg);\n }\n 100% {\n width: 10px;\n top: 8px;\n transform: rotate(-45deg);\n }\n}\n\n@-webkit-keyframes clepit-firework-11 {\n 0% {\n opacity: 1;\n box-shadow: 0 0 0 -2px var(--clepit-marker), 0 0 0 -2px var(--clepit-marker), 0 0 0 -2px var(--clepit-marker), 0 0 0 -2px var(--clepit-marker), 0 0 0 -2px var(--clepit-marker), 0 0 0 -2px var(--clepit-marker);\n }\n 30% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n box-shadow: 0 -15px 0 0px var(--clepit-marker), 14px -8px 0 0px var(--clepit-marker), 14px 8px 0 0px var(--clepit-marker), 0 15px 0 0px var(--clepit-marker), -14px 8px 0 0px var(--clepit-marker), -14px -8px 0 0px var(--clepit-marker);\n }\n}\n\n@keyframes clepit-firework-11 {\n 0% {\n opacity: 1;\n box-shadow: 0 0 0 -2px var(--clepit-marker), 0 0 0 -2px var(--clepit-marker), 0 0 0 -2px var(--clepit-marker), 0 0 0 -2px var(--clepit-marker), 0 0 0 -2px var(--clepit-marker), 0 0 0 -2px var(--clepit-marker);\n }\n 30% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n box-shadow: 0 -15px 0 0px var(--clepit-marker), 14px -8px 0 0px var(--clepit-marker), 14px 8px 0 0px var(--clepit-marker), 0 15px 0 0px var(--clepit-marker), -14px 8px 0 0px var(--clepit-marker), -14px -8px 0 0px var(--clepit-marker);\n }\n}\n";
4
+ export declare const outputStyle = "\n/* Checklist output block styles */\n.clepit-output-checklist {\n margin: 0 0 1rem 0;\n padding-left: 0;\n}\n\n.clepit-output-checklist-item {\n --text: var(--clepit-text);\n --check: var(--clepit-primary);\n --disabled: var(--clepit-text-muted);\n --border-radius: 10px;\n border-radius: var(--border-radius);\n position: relative;\n padding: 5px;\n display: grid;\n grid-template-columns: 30px auto;\n align-items: center;\n margin: 0.5rem 0;\n line-height: 1.6;\n}\n\n.clepit-output-checklist-text {\n color: var(--text);\n position: relative;\n cursor: pointer;\n display: grid;\n align-items: center;\n width: -webkit-fit-content;\n width: -moz-fit-content;\n width: fit-content;\n transition: color 0.3s ease;\n line-height: 1.6;\n}\n\n.clepit-output-checklist-text::before,\n.clepit-output-checklist-text::after {\n content: \"\";\n position: absolute;\n}\n\n.clepit-output-checklist-text::before {\n height: 2px;\n width: 8px;\n left: -27px;\n background: var(--check);\n border-radius: 2px;\n transition: background 0.3s ease;\n}\n\n.clepit-output-checklist-text::after {\n height: 4px;\n width: 4px;\n top: 8px;\n left: -25px;\n border-radius: 50%;\n}\n\n.clepit-output-checklist-checkbox {\n -webkit-appearance: none;\n -moz-appearance: none;\n position: relative;\n height: 15px;\n width: 15px;\n outline: none;\n border: 0;\n margin: 0 15px 0 0;\n cursor: pointer;\n background: var(--background);\n display: grid;\n align-items: center;\n pointer-events: none;\n}\n\n.clepit-output-checklist-checkbox::before,\n.clepit-output-checklist-checkbox::after {\n content: \"\";\n position: absolute;\n height: 2px;\n top: auto;\n background: var(--check);\n border-radius: 2px;\n}\n\n.clepit-output-checklist-checkbox::before {\n width: 0px;\n right: 60%;\n transform-origin: right bottom;\n}\n\n.clepit-output-checklist-checkbox::after {\n width: 0px;\n left: 40%;\n transform-origin: left bottom;\n}\n\n.clepit-output-checklist-checkbox:checked::before {\n -webkit-animation: clepit-check-01-11 0.4s ease forwards;\n animation: clepit-check-01-11 0.4s ease forwards;\n}\n\n.clepit-output-checklist-checkbox:checked::after {\n -webkit-animation: clepit-check-02-11 0.4s ease forwards;\n animation: clepit-check-02-11 0.4s ease forwards;\n}\n\n.clepit-output-checklist-checkbox:checked + .clepit-output-checklist-text {\n color: var(--disabled);\n -webkit-animation: clepit-move-11 0.3s ease 0.1s forwards;\n animation: clepit-move-11 0.3s ease 0.1s forwards;\n}\n\n.clepit-output-checklist-checkbox:checked + .clepit-output-checklist-text::before {\n background: var(--disabled);\n -webkit-animation: clepit-slice-11 0.4s ease forwards;\n animation: clepit-slice-11 0.4s ease forwards;\n}\n\n.clepit-output-checklist-checkbox:checked + .clepit-output-checklist-text::after {\n -webkit-animation: clepit-firework-11 0.5s ease forwards 0.1s;\n animation: clepit-firework-11 0.5s ease forwards 0.1s;\n}\n\n@-webkit-keyframes clepit-move-11 {\n 50% {\n padding-left: 8px;\n padding-right: 0px;\n }\n 100% {\n padding-right: 4px;\n }\n}\n\n@keyframes clepit-move-11 {\n 50% {\n padding-left: 8px;\n padding-right: 0px;\n }\n 100% {\n padding-right: 4px;\n }\n}\n\n@-webkit-keyframes clepit-slice-11 {\n 60% {\n width: 100%;\n left: 4px;\n }\n 100% {\n width: 100%;\n left: -2px;\n padding-left: 0;\n }\n}\n\n@keyframes clepit-slice-11 {\n 60% {\n width: 100%;\n left: 4px;\n }\n 100% {\n width: 100%;\n left: -2px;\n padding-left: 0;\n }\n}\n\n@-webkit-keyframes clepit-check-01-11 {\n 0% {\n width: 4px;\n top: auto;\n transform: rotate(0);\n }\n 50% {\n width: 0px;\n top: auto;\n transform: rotate(0);\n }\n 51% {\n width: 0px;\n top: 8px;\n transform: rotate(45deg);\n }\n 100% {\n width: 5px;\n top: 8px;\n transform: rotate(45deg);\n }\n}\n\n@keyframes clepit-check-01-11 {\n 0% {\n width: 4px;\n top: auto;\n transform: rotate(0);\n }\n 50% {\n width: 0px;\n top: auto;\n transform: rotate(0);\n }\n 51% {\n width: 0px;\n top: 8px;\n transform: rotate(45deg);\n }\n 100% {\n width: 5px;\n top: 8px;\n transform: rotate(45deg);\n }\n}\n\n@-webkit-keyframes clepit-check-02-11 {\n 0% {\n width: 4px;\n top: 17px;\n transform: rotate(0);\n }\n 50% {\n width: 0px;\n top: 17px;\n transform: rotate(0);\n }\n 51% {\n width: 0px;\n top: 8px;\n transform: rotate(-45deg);\n }\n 100% {\n width: 10px;\n top: 8px;\n transform: rotate(-45deg);\n }\n}\n\n@keyframes clepit-check-02-11 {\n 0% {\n width: 4px;\n top: 17px;\n transform: rotate(0);\n }\n 50% {\n width: 0px;\n top: 17px;\n transform: rotate(0);\n }\n 51% {\n width: 0px;\n top: 8px;\n transform: rotate(-45deg);\n }\n 100% {\n width: 10px;\n top: 8px;\n transform: rotate(-45deg);\n }\n}\n\n@-webkit-keyframes clepit-firework-11 {\n 0% {\n opacity: 1;\n box-shadow: 0 0 0 -2px var(--check), 0 0 0 -2px var(--check), 0 0 0 -2px var(--check), 0 0 0 -2px var(--check), 0 0 0 -2px var(--check), 0 0 0 -2px var(--check);\n }\n 30% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n box-shadow: 0 -15px 0 0px var(--check), 14px -8px 0 0px var(--check), 14px 8px 0 0px var(--check), 0 15px 0 0px var(--check), -14px 8px 0 0px var(--check), -14px -8px 0 0px var(--check);\n }\n}\n\n@keyframes clepit-firework-11 {\n 0% {\n opacity: 1;\n box-shadow: 0 0 0 -2px var(--check), 0 0 0 -2px var(--check), 0 0 0 -2px var(--check), 0 0 0 -2px var(--check), 0 0 0 -2px var(--check), 0 0 0 -2px var(--check);\n }\n 30% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n box-shadow: 0 -15px 0 0px var(--check), 14px -8px 0 0px var(--check), 14px 8px 0 0px var(--check), 0 15px 0 0px var(--check), -14px 8px 0 0px var(--check), -14px -8px 0 0px var(--check);\n }\n}\n";
5
5
  //# sourceMappingURL=css.d.ts.map
package/dist/types.d.ts CHANGED
@@ -818,12 +818,31 @@ export interface BlockTune {
818
818
  save: (element: HTMLElement) => BlockTuneData;
819
819
  }
820
820
  export type UploadFunction = (file: File) => Promise<string>;
821
- export type BlockTuneData = {
822
- [key: string]: string | number | boolean | null | undefined;
823
- };
821
+ /**
822
+ * One tune's value.
823
+ *
824
+ * Flat, because every path that reads or writes a tune treats it as a scalar: `getBlockTunes` reads
825
+ * `data-value` off the DOM, the renderer writes `String(value)` into an attribute, and the server's
826
+ * block reconciler round-trips `{"align": "center"}` through `__tunes`.
827
+ */
828
+ export type BlockTuneValue = string | number | boolean | null | undefined;
829
+ /**
830
+ * A block's tunes.
831
+ *
832
+ * NARROWED 2026-08-27. This was declared as `{ [key: string]: BlockTuneData }`, one level deeper
833
+ * than anything that has ever written or read it, and three `as` casts existed only to get the flat
834
+ * runtime shape past it. A nested value reached the renderer as `String(object)` and rendered
835
+ * `[object Object]`. The per-tune data bag existed for the `BlockTune` interface, which has zero
836
+ * implementations in either the TypeScript or the Dart port.
837
+ */
824
838
  export type BlockTunes = {
825
- [key: string]: BlockTuneData;
839
+ [key: string]: BlockTuneValue;
826
840
  };
841
+ /**
842
+ * @deprecated The nested per-tune bag the old `BlockTunes` pointed at. Nothing implements it; kept
843
+ * as an alias for one release so an external consumer's import does not fail to resolve.
844
+ */
845
+ export type BlockTuneData = BlockTunes;
827
846
  export type BlockTypeOutputConfigs = {
828
847
  [K in ToolType]: OutputConfig;
829
848
  };
@@ -873,10 +892,13 @@ export type EditorConfig = {
873
892
  onInlineRewrite?: (selection: string, action: InlineRewriteAction) => Promise<string | null>;
874
893
  inlineRewriteLabels?: Partial<Record<InlineRewriteAction, string>>;
875
894
  blockToolLabels?: Partial<Record<BlockToolType, string>>;
876
- blockToolbarLabels?: Partial<Record<BlockToolbarOperation, string>>;
895
+ blockToolbarLabels?: Partial<Record<BlockToolbarLabel, string>>;
877
896
  };
878
897
  export declare const BLOCK_TOOLBAR_OPERATIONS: readonly ["convert", "moveUp", "moveDown", "delete"];
879
898
  export type BlockToolbarOperation = (typeof BLOCK_TOOLBAR_OPERATIONS)[number];
899
+ export declare const BLOCK_MENU_LABELS: readonly ["searchBlocks", "searchOperations", "searchConvertOptions", "searchLanguages", "searchThemes", "noBlockTypesFound", "noOperationsFound", "noConvertOptionsFound", "alignLeft", "alignCenter", "alignRight", "codeLanguage", "codeTheme", "headingH1", "headingH2", "headingH3", "headingH4", "headingH5", "headingH6", "listUnordered", "listOrdered", "variantInfo", "variantWarning", "variantError", "variantSuccess", "variantPlain", "delimiterLine", "delimiterStars"];
900
+ export type BlockMenuLabel = (typeof BLOCK_MENU_LABELS)[number];
901
+ export type BlockToolbarLabel = BlockToolbarOperation | BlockMenuLabel;
880
902
  export declare const INLINE_REWRITE_ACTIONS: readonly ["improve", "shorten", "lengthen", "simplify", "fix_grammar"];
881
903
  export type InlineRewriteAction = (typeof INLINE_REWRITE_ACTIONS)[number];
882
904
  export type RendererConfig = {
@@ -911,7 +933,7 @@ export type EditorAPI = {
911
933
  blocks: {
912
934
  getAll: () => Block[];
913
935
  get: (blockId: string) => Block | null;
914
- insert: <T extends BlockToolType>(type: T, data: Block<T>['data'], index: number) => HTMLElement | null;
936
+ insert: <T extends BlockToolType>(type: T, data: Block<T>['data'], index: number, id?: string) => HTMLElement | null;
915
937
  update: <T extends BlockToolType>(blockId: string, data: Block<T>['data']) => void;
916
938
  remove: (index: number) => void;
917
939
  move: (fromIndex: number, toIndex: number) => void;
package/package.json CHANGED
@@ -5,17 +5,23 @@
5
5
  "devDependencies": {
6
6
  "@bomdisoft/store": "0.0.0",
7
7
  "@bomdisoft/typescript-config": "0.0.0",
8
- "@happy-dom/global-registrator": "^20.10.3",
9
- "@types/bun": "^1.3.14",
10
- "terser": "^5.48.0",
11
- "vite": "^8.0.16",
12
- "vite-plugin-dts": "^5.0.2"
8
+ "@happy-dom/global-registrator": "^20.11.6",
9
+ "@types/bun": "^1.4.0",
10
+ "terser": "^5.50.0",
11
+ "typescript": "^6.0.3",
12
+ "vite": "^8.2.2",
13
+ "vite-plugin-dts": "^5.0.3"
13
14
  },
14
15
  "exports": {
15
16
  ".": {
16
17
  "import": "./dist/index.mjs",
17
18
  "require": "./dist/index.js",
18
19
  "types": "./dist/index.d.ts"
20
+ },
21
+ "./code": {
22
+ "import": "./dist/code.mjs",
23
+ "require": "./dist/code.js",
24
+ "types": "./dist/code.d.ts"
19
25
  }
20
26
  },
21
27
  "files": ["dist", "!dist/**/*.map", "CHANGELOG.md", "LICENSE", "README.md"],
@@ -45,6 +51,7 @@
45
51
  "test:watch": "bun test test --isolate --watch --pass-with-no-tests",
46
52
  "typecheck": "tsc --noEmit -p tsconfig.typecheck.json"
47
53
  },
54
+ "sideEffects": false,
48
55
  "types": "dist/index.d.ts",
49
- "version": "0.3.0"
56
+ "version": "0.4.0-beta.340"
50
57
  }