@newtonedev/editor 0.1.11 → 0.2.0

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.
Files changed (116) hide show
  1. package/dist/Editor.d.ts.map +1 -1
  2. package/dist/components/CodeBlock.d.ts.map +1 -1
  3. package/dist/components/ConfiguratorPanel.d.ts +6 -3
  4. package/dist/components/ConfiguratorPanel.d.ts.map +1 -1
  5. package/dist/components/EditorHeader.d.ts +3 -2
  6. package/dist/components/EditorHeader.d.ts.map +1 -1
  7. package/dist/components/EditorShell.d.ts.map +1 -1
  8. package/dist/components/PresetSelector.d.ts +3 -2
  9. package/dist/components/PresetSelector.d.ts.map +1 -1
  10. package/dist/components/PreviewWindow.d.ts.map +1 -1
  11. package/dist/components/RightSidebar.d.ts.map +1 -1
  12. package/dist/components/Sidebar.d.ts +8 -1
  13. package/dist/components/Sidebar.d.ts.map +1 -1
  14. package/dist/components/TableOfContents.d.ts.map +1 -1
  15. package/dist/components/sections/ColorsSection.d.ts +6 -3
  16. package/dist/components/sections/ColorsSection.d.ts.map +1 -1
  17. package/dist/components/sections/DynamicRangeSection.d.ts +2 -2
  18. package/dist/components/sections/DynamicRangeSection.d.ts.map +1 -1
  19. package/dist/components/sections/FontsSection.d.ts +2 -2
  20. package/dist/components/sections/FontsSection.d.ts.map +1 -1
  21. package/dist/components/sections/IconsSection.d.ts +2 -2
  22. package/dist/components/sections/IconsSection.d.ts.map +1 -1
  23. package/dist/components/sections/OthersSection.d.ts +2 -2
  24. package/dist/components/sections/OthersSection.d.ts.map +1 -1
  25. package/dist/components/sections/ScalePlots.d.ts +11 -0
  26. package/dist/components/sections/ScalePlots.d.ts.map +1 -0
  27. package/dist/components/sections/index.d.ts +1 -0
  28. package/dist/components/sections/index.d.ts.map +1 -1
  29. package/dist/configurator/bridge/toCSS.d.ts +7 -0
  30. package/dist/configurator/bridge/toCSS.d.ts.map +1 -0
  31. package/dist/configurator/bridge/toJSON.d.ts +15 -0
  32. package/dist/configurator/bridge/toJSON.d.ts.map +1 -0
  33. package/dist/configurator/bridge/toThemeConfig.d.ts +8 -0
  34. package/dist/configurator/bridge/toThemeConfig.d.ts.map +1 -0
  35. package/dist/configurator/constants.d.ts +13 -0
  36. package/dist/configurator/constants.d.ts.map +1 -0
  37. package/dist/configurator/hex-conversion.d.ts +21 -0
  38. package/dist/configurator/hex-conversion.d.ts.map +1 -0
  39. package/dist/configurator/hooks/useConfigurator.d.ts +11 -0
  40. package/dist/configurator/hooks/useConfigurator.d.ts.map +1 -0
  41. package/dist/configurator/hooks/usePreviewColors.d.ts +8 -0
  42. package/dist/configurator/hooks/usePreviewColors.d.ts.map +1 -0
  43. package/dist/configurator/hooks/useWcagValidation.d.ts +20 -0
  44. package/dist/configurator/hooks/useWcagValidation.d.ts.map +1 -0
  45. package/dist/configurator/hue-conversion.d.ts +10 -0
  46. package/dist/configurator/hue-conversion.d.ts.map +1 -0
  47. package/dist/configurator/state/actions.d.ts +107 -0
  48. package/dist/configurator/state/actions.d.ts.map +1 -0
  49. package/dist/configurator/state/defaults.d.ts +7 -0
  50. package/dist/configurator/state/defaults.d.ts.map +1 -0
  51. package/dist/configurator/state/reducer.d.ts +19 -0
  52. package/dist/configurator/state/reducer.d.ts.map +1 -0
  53. package/dist/configurator/types.d.ts +60 -0
  54. package/dist/configurator/types.d.ts.map +1 -0
  55. package/dist/hooks/useEditorState.d.ts +8 -6
  56. package/dist/hooks/useEditorState.d.ts.map +1 -1
  57. package/dist/hooks/usePresets.d.ts +7 -6
  58. package/dist/hooks/usePresets.d.ts.map +1 -1
  59. package/dist/index.cjs +30380 -828
  60. package/dist/index.cjs.map +1 -1
  61. package/dist/index.d.ts +17 -0
  62. package/dist/index.d.ts.map +1 -1
  63. package/dist/index.js +30359 -819
  64. package/dist/index.js.map +1 -1
  65. package/dist/preview/CategoryView.d.ts.map +1 -1
  66. package/dist/preview/ComponentDetailView.d.ts.map +1 -1
  67. package/dist/preview/ComponentRenderer.d.ts.map +1 -1
  68. package/dist/preview/IconBrowserView.d.ts.map +1 -1
  69. package/dist/preview/OverviewView.d.ts.map +1 -1
  70. package/dist/preview/PaletteScaleView.d.ts +11 -0
  71. package/dist/preview/PaletteScaleView.d.ts.map +1 -0
  72. package/dist/types.d.ts +4 -3
  73. package/dist/types.d.ts.map +1 -1
  74. package/package.json +7 -4
  75. package/src/Editor.tsx +43 -19
  76. package/src/components/CodeBlock.tsx +7 -11
  77. package/src/components/ConfiguratorPanel.tsx +25 -18
  78. package/src/components/EditorHeader.tsx +29 -39
  79. package/src/components/EditorShell.tsx +17 -29
  80. package/src/components/FontPicker.tsx +7 -7
  81. package/src/components/PresetSelector.tsx +211 -129
  82. package/src/components/PreviewWindow.tsx +5 -12
  83. package/src/components/PrimaryNav.tsx +6 -6
  84. package/src/components/RightSidebar.tsx +24 -25
  85. package/src/components/Sidebar.tsx +54 -60
  86. package/src/components/TableOfContents.tsx +4 -5
  87. package/src/components/sections/ColorsSection.tsx +118 -147
  88. package/src/components/sections/DynamicRangeSection.tsx +61 -75
  89. package/src/components/sections/FontsSection.tsx +17 -28
  90. package/src/components/sections/IconsSection.tsx +2 -2
  91. package/src/components/sections/OthersSection.tsx +4 -5
  92. package/src/components/sections/ScalePlots.tsx +221 -0
  93. package/src/components/sections/index.ts +1 -0
  94. package/src/configurator/bridge/toCSS.ts +44 -0
  95. package/src/configurator/bridge/toJSON.ts +24 -0
  96. package/src/configurator/bridge/toThemeConfig.ts +114 -0
  97. package/src/configurator/constants.ts +13 -0
  98. package/src/configurator/hex-conversion.ts +67 -0
  99. package/src/configurator/hooks/useConfigurator.ts +33 -0
  100. package/src/configurator/hooks/usePreviewColors.ts +47 -0
  101. package/src/configurator/hooks/useWcagValidation.ts +133 -0
  102. package/src/configurator/hue-conversion.ts +25 -0
  103. package/src/configurator/state/actions.ts +43 -0
  104. package/src/configurator/state/defaults.ts +107 -0
  105. package/src/configurator/state/reducer.ts +399 -0
  106. package/src/configurator/types.ts +65 -0
  107. package/src/hooks/useEditorState.ts +25 -11
  108. package/src/hooks/usePresets.ts +54 -33
  109. package/src/index.ts +33 -0
  110. package/src/preview/CategoryView.tsx +8 -11
  111. package/src/preview/ComponentDetailView.tsx +24 -54
  112. package/src/preview/ComponentRenderer.tsx +2 -4
  113. package/src/preview/IconBrowserView.tsx +9 -10
  114. package/src/preview/OverviewView.tsx +9 -12
  115. package/src/preview/PaletteScaleView.tsx +122 -0
  116. package/src/types.ts +4 -3
@@ -0,0 +1,60 @@
1
+ import type { ColorMode } from '@newtonedev/components';
2
+ export type { FontConfig, FontScope } from '@newtonedev/fonts';
3
+ export type { FontSlot as FontSlotConfig } from '@newtonedev/fonts';
4
+ import type { FontSlot, TextRole } from '@newtonedev/fonts';
5
+ /** Spacing preset options */
6
+ export type SpacingPreset = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
7
+ /** Per-palette state in the configurator */
8
+ export interface PaletteState {
9
+ readonly name: string;
10
+ readonly hue: number;
11
+ readonly chromaRatio: number;
12
+ readonly chromaPeak: number;
13
+ readonly localHueGrade?: {
14
+ readonly hue: number;
15
+ readonly intensity: number;
16
+ readonly side: 'light' | 'dark';
17
+ };
18
+ readonly keyColorStep?: number;
19
+ readonly keyColorStepDark?: number;
20
+ }
21
+ /** Complete configurator state */
22
+ export interface ConfiguratorState {
23
+ readonly hueSpace?: 'oklch';
24
+ readonly palettes: readonly PaletteState[];
25
+ readonly dynamicRange: {
26
+ readonly lightest: number;
27
+ readonly darkest: number;
28
+ };
29
+ readonly globalHueGrading: {
30
+ readonly lightHue: number;
31
+ readonly lightIntensity: number;
32
+ readonly darkHue: number;
33
+ readonly darkIntensity: number;
34
+ };
35
+ readonly preview: {
36
+ readonly mode: ColorMode;
37
+ };
38
+ readonly spacing?: {
39
+ readonly preset: SpacingPreset;
40
+ };
41
+ readonly roundness?: {
42
+ readonly intensity: number;
43
+ };
44
+ readonly typography?: {
45
+ readonly fonts: {
46
+ readonly main: FontSlot;
47
+ readonly display: FontSlot;
48
+ readonly mono: FontSlot;
49
+ readonly currency: FontSlot;
50
+ };
51
+ readonly typeScaleOffset?: number;
52
+ readonly roleWeights?: Partial<Record<TextRole, number>>;
53
+ };
54
+ readonly icons?: {
55
+ readonly variant: 'outlined' | 'rounded' | 'sharp';
56
+ readonly weight: 100 | 200 | 300 | 400 | 500 | 600 | 700;
57
+ readonly autoGrade: boolean;
58
+ };
59
+ }
60
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/configurator/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGxD,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE/D,YAAY,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D,6BAA6B;AAC7B,MAAM,MAAM,aAAa,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE7D,4CAA4C;AAC5C,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,aAAa,CAAC,EAAE;QACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAC3B,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;KACjC,CAAC;IACF,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MA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,CAAC,EAAE;QACf,QAAQ,CAAC,OAAO,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC;QACnD,QAAQ,CAAC,MAAM,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;QACzD,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;KAC7B,CAAC;CACH"}
@@ -1,5 +1,5 @@
1
1
  import type { ColorMode } from "@newtonedev/components";
2
- import type { ConfiguratorState } from "@newtonedev/configurator";
2
+ import type { ConfiguratorState } from "../configurator/types";
3
3
  import type { Preset, SaveStatus, PreviewView, SidebarSelection, EditorPersistence } from "../types";
4
4
  interface UseEditorStateOptions {
5
5
  readonly initialState: ConfiguratorState;
@@ -12,12 +12,13 @@ interface UseEditorStateOptions {
12
12
  readonly onNavigate?: (view: PreviewView) => void;
13
13
  readonly initialPreviewView?: PreviewView;
14
14
  readonly manifestUrl?: string;
15
+ readonly useP3?: boolean;
15
16
  }
16
- export declare function useEditorState({ initialState, initialIsPublished, initialPresets, initialActivePresetId, initialPublishedPresetId, defaultState, persistence, onNavigate, initialPreviewView, manifestUrl, }: UseEditorStateOptions): {
17
+ export declare function useEditorState({ initialState, initialIsPublished, initialPresets, initialActivePresetId, initialPublishedPresetId, defaultState, persistence, onNavigate, initialPreviewView, manifestUrl, useP3, }: UseEditorStateOptions): {
17
18
  readonly configuratorState: ConfiguratorState;
18
- readonly dispatch: (action: import("@newtonedev/configurator").ConfiguratorAction) => void;
19
- readonly themeConfig: import("@newtonedev/components").NewtoneThemeConfig;
20
- readonly previewColors: readonly (readonly import("@newtonedev/components").ColorResult[])[];
19
+ readonly dispatch: (action: import("..").ConfiguratorAction) => void;
20
+ readonly themeConfig: import("newtone-api").NewtoneThemeConfig;
21
+ readonly previewColors: readonly (readonly import("newtone").ColorResult[])[];
21
22
  readonly saveStatus: SaveStatus;
22
23
  readonly isPublished: boolean;
23
24
  readonly publishing: boolean;
@@ -40,12 +41,13 @@ export declare function useEditorState({ initialState, initialIsPublished, initi
40
41
  readonly handleScopeToComponent: () => void;
41
42
  readonly presets: readonly Preset[];
42
43
  readonly activePresetId: string;
43
- readonly publishedPresetId: string | null;
44
+ readonly defaultVariantId: string | null;
44
45
  readonly switchPreset: (presetId: string) => Promise<void>;
45
46
  readonly createPreset: (name: string) => Promise<string>;
46
47
  readonly renamePreset: (presetId: string, name: string) => void;
47
48
  readonly deletePreset: (presetId: string) => Promise<void>;
48
49
  readonly duplicatePreset: (presetId: string, newName: string) => Promise<string>;
50
+ readonly setDefaultVariant: (presetId: string) => void;
49
51
  readonly isDirty: boolean;
50
52
  readonly handleRevert: () => void;
51
53
  readonly latestStateRef: import("react").MutableRefObject<ConfiguratorState>;
@@ -1 +1 @@
1
- {"version":3,"file":"useEditorState.d.ts","sourceRoot":"","sources":["../../src/hooks/useEditorState.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAGlE,OAAO,KAAK,EACV,MAAM,EACN,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,UAAU,CAAC;AAIlB,UAAU,qBAAqB;IAC7B,QAAQ,CAAC,YAAY,EAAE,iBAAiB,CAAC;IACzC,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAC;IACrC,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAC;IACvC,QAAQ,CAAC,wBAAwB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjD,QAAQ,CAAC,YAAY,EAAE,iBAAiB,CAAC;IACzC,QAAQ,CAAC,WAAW,EAAE,iBAAiB,CAAC;IACxC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAC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C,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,wBAAgB,cAAc,CAAC,EAC7B,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,wBAAwB,EACxB,YAAY,EACZ,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,WAAW,EACX,KAAK,GACN,EAAE,qBAAqB;;;;;;;;;gCA4ON,iBAAiB;;;;2CA3GxB,WAAW;8CAsBN,MAAM;8CA8BN,MAAM;2CA6FX,SAAS;;;;;4CAhEL,MAAM,SAAS,OAAO;;;;;;;;;;;;;;;;EAyMpC"}
@@ -1,9 +1,9 @@
1
- import type { ConfiguratorState } from "@newtonedev/configurator";
1
+ import type { ConfiguratorState } from "../configurator/types";
2
2
  import type { Preset } from "../types";
3
3
  interface UsePresetsOptions {
4
4
  readonly initialPresets: readonly Preset[];
5
5
  readonly initialActivePresetId: string;
6
- readonly initialPublishedPresetId: string | null;
6
+ readonly initialDefaultVariantId: string | null;
7
7
  readonly defaultState: ConfiguratorState;
8
8
  readonly onPresetSwitch: (newState: ConfiguratorState) => void;
9
9
  readonly getCurrentState: () => ConfiguratorState;
@@ -11,13 +11,13 @@ interface UsePresetsOptions {
11
11
  readonly persistPresets: (params: {
12
12
  readonly presets: readonly Preset[];
13
13
  readonly activePresetId: string;
14
- readonly publishedPresetId: string | null;
14
+ readonly defaultVariantId: string | null;
15
15
  }) => Promise<void>;
16
16
  }
17
17
  interface UsePresetsReturn {
18
18
  readonly presets: readonly Preset[];
19
19
  readonly activePresetId: string;
20
- readonly publishedPresetId: string | null;
20
+ readonly defaultVariantId: string | null;
21
21
  readonly activePreset: Preset;
22
22
  readonly switchPreset: (presetId: string) => Promise<void>;
23
23
  readonly createPreset: (name: string) => Promise<string>;
@@ -25,9 +25,10 @@ interface UsePresetsReturn {
25
25
  readonly deletePreset: (presetId: string) => Promise<void>;
26
26
  readonly duplicatePreset: (presetId: string, newName: string) => Promise<string>;
27
27
  readonly updateActivePresetDraftState: (state: ConfiguratorState) => readonly Preset[];
28
- readonly publishActivePreset: (state: ConfiguratorState) => readonly Preset[];
28
+ readonly publishAllVariants: (state: ConfiguratorState) => readonly Preset[];
29
29
  readonly revertActivePreset: () => ConfiguratorState | null;
30
+ readonly setDefaultVariant: (presetId: string) => void;
30
31
  }
31
- export declare function usePresets({ initialPresets, initialActivePresetId, initialPublishedPresetId, defaultState, onPresetSwitch, getCurrentState, flushPendingSave, persistPresets, }: UsePresetsOptions): UsePresetsReturn;
32
+ export declare function usePresets({ initialPresets, initialActivePresetId, initialDefaultVariantId, defaultState, onPresetSwitch, getCurrentState, flushPendingSave, persistPresets, }: UsePresetsOptions): UsePresetsReturn;
32
33
  export {};
33
34
  //# sourceMappingURL=usePresets.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePresets.d.ts","sourceRoot":"","sources":["../../src/hooks/usePresets.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,UAAU,iBAAiB;IACzB,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAC;IACvC,QAAQ,CAAC,wBAAwB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjD,QAAQ,CAAC,YAAY,EAAE,iBAAiB,CAAC;IACzC,QAAQ,CAAC,cAAc,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC/D,QAAQ,CAAC,eAAe,EAAE,MAAM,iBAAiB,CAAC;IAClD,QAAQ,CAAC,gBAAgB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,QAAQ,CAAC,cAAc,EAAE,CAAC,MAAM,EAAE;QAChC,QAAQ,CAAC,OA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