@clepit/core 0.3.0-beta.339 → 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.
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
  };
@@ -914,7 +933,7 @@ export type EditorAPI = {
914
933
  blocks: {
915
934
  getAll: () => Block[];
916
935
  get: (blockId: string) => Block | null;
917
- 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;
918
937
  update: <T extends BlockToolType>(blockId: string, data: Block<T>['data']) => void;
919
938
  remove: (index: number) => void;
920
939
  move: (fromIndex: number, toIndex: number) => void;
package/package.json CHANGED
@@ -53,5 +53,5 @@
53
53
  },
54
54
  "sideEffects": false,
55
55
  "types": "dist/index.d.ts",
56
- "version": "0.3.0-beta.339"
56
+ "version": "0.4.0-beta.340"
57
57
  }