@squaredr/fieldcraft-pro 1.6.2 → 1.6.4
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/{chunk-Y6JWJY3A.mjs → chunk-CFVT2R42.mjs} +19 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +19 -2
- package/dist/index.mjs +2 -2
- package/dist/theme-editor/index.d.mts +1 -3
- package/dist/theme-editor/index.d.ts +1 -3
- package/dist/theme-editor/index.js +18 -1
- package/dist/theme-editor/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -1048,6 +1048,24 @@ function ThemeEditorInner({
|
|
|
1048
1048
|
const [showComparison, setShowComparison] = useState(false);
|
|
1049
1049
|
const themeRef = useRef(theme);
|
|
1050
1050
|
themeRef.current = theme;
|
|
1051
|
+
const hasInitialTheme = useRef(initialTheme != null);
|
|
1052
|
+
useEffect(() => {
|
|
1053
|
+
if (hasInitialTheme.current) return;
|
|
1054
|
+
if (typeof window === "undefined") return;
|
|
1055
|
+
const observer = new MutationObserver(() => {
|
|
1056
|
+
requestAnimationFrame(() => {
|
|
1057
|
+
const resolved = resolveThemeFromDOM();
|
|
1058
|
+
setTheme(resolved);
|
|
1059
|
+
setPresetKey("custom");
|
|
1060
|
+
onChange?.(resolved);
|
|
1061
|
+
});
|
|
1062
|
+
});
|
|
1063
|
+
observer.observe(document.documentElement, {
|
|
1064
|
+
attributes: true,
|
|
1065
|
+
attributeFilter: ["data-theme", "class"]
|
|
1066
|
+
});
|
|
1067
|
+
return () => observer.disconnect();
|
|
1068
|
+
}, [onChange]);
|
|
1051
1069
|
useEffect(() => {
|
|
1052
1070
|
function handleKeyDown(e) {
|
|
1053
1071
|
if ((e.metaKey || e.ctrlKey) && e.key === "s") {
|
|
@@ -1349,4 +1367,4 @@ var themeEditorDarkPreset = {
|
|
|
1349
1367
|
accentForeground: "#0F1A1F"
|
|
1350
1368
|
};
|
|
1351
1369
|
|
|
1352
|
-
export { PRESET_FAMILIES, PREVIEW_SCHEMA, ThemeEditor,
|
|
1370
|
+
export { PRESET_FAMILIES, PREVIEW_SCHEMA, ThemeEditor, ThemeEditorThemeProvider, resolveThemeFromDOM, themeEditorDarkPreset, themeEditorLightPreset, useEditorTheme };
|
package/dist/index.d.mts
CHANGED
|
@@ -3,7 +3,7 @@ import { ReactNode, ComponentType } from 'react';
|
|
|
3
3
|
export { B as BuilderState, a as BuilderStateHook, D as DEFAULT_PALETTE, b as DEFAULT_SCHEMA, c as DragItem, d as DropTarget, F as FormBuilder, e as FormBuilderPreviewProps, f as FormBuilderProps, g as FormBuilderTemplate, h as FormBuilderTheme, i as FormBuilderThemeProvider, M as MutationAction, P as PaletteCategory, j as PropertyPanelTab, Q as QUESTION_TYPE_INFO, k as QuestionTypeCategory, l as QuestionTypeInfo, S as SelectedItem, U as UndoRedoState, m as addOption, n as addQuestion, o as addSection, p as cn, q as duplicateQuestion, r as duplicateSection, s as findQuestion, t as findSection, u as generateId, v as generateOptionId, w as generateQuestionId, x as generateSectionId, y as moveOption, z as moveQuestion, A as moveSection, C as removeOption, E as removeQuestion, G as removeSection, H as updateOption, I as updateQuestion, J as updateSection, K as useBuilderState, L as useBuilderTheme, N as useDragDrop, O as useUndoRedo } from './index-D19524df.mjs';
|
|
4
4
|
import { FieldComponent, FieldProps } from '@squaredr/fieldcraft-react';
|
|
5
5
|
export { ResponseField, ResponseViewer, ResponseViewerProps, ViewMode } from './response-viewer/index.mjs';
|
|
6
|
-
export { PRESET_FAMILIES, PREVIEW_SCHEMA, PresetFamily, ThemeEditor,
|
|
6
|
+
export { PRESET_FAMILIES, PREVIEW_SCHEMA, PresetFamily, ThemeEditor, ThemeEditorProps, ThemeEditorTheme, ThemeEditorThemeProvider, resolveThemeFromDOM, themeEditorDarkPreset, themeEditorLightPreset, useEditorTheme } from './theme-editor/index.mjs';
|
|
7
7
|
import '@squaredr/fieldcraft-core';
|
|
8
8
|
import 'clsx';
|
|
9
9
|
import '@dnd-kit/core';
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { ReactNode, ComponentType } from 'react';
|
|
|
3
3
|
export { B as BuilderState, a as BuilderStateHook, D as DEFAULT_PALETTE, b as DEFAULT_SCHEMA, c as DragItem, d as DropTarget, F as FormBuilder, e as FormBuilderPreviewProps, f as FormBuilderProps, g as FormBuilderTemplate, h as FormBuilderTheme, i as FormBuilderThemeProvider, M as MutationAction, P as PaletteCategory, j as PropertyPanelTab, Q as QUESTION_TYPE_INFO, k as QuestionTypeCategory, l as QuestionTypeInfo, S as SelectedItem, U as UndoRedoState, m as addOption, n as addQuestion, o as addSection, p as cn, q as duplicateQuestion, r as duplicateSection, s as findQuestion, t as findSection, u as generateId, v as generateOptionId, w as generateQuestionId, x as generateSectionId, y as moveOption, z as moveQuestion, A as moveSection, C as removeOption, E as removeQuestion, G as removeSection, H as updateOption, I as updateQuestion, J as updateSection, K as useBuilderState, L as useBuilderTheme, N as useDragDrop, O as useUndoRedo } from './index-D19524df.js';
|
|
4
4
|
import { FieldComponent, FieldProps } from '@squaredr/fieldcraft-react';
|
|
5
5
|
export { ResponseField, ResponseViewer, ResponseViewerProps, ViewMode } from './response-viewer/index.js';
|
|
6
|
-
export { PRESET_FAMILIES, PREVIEW_SCHEMA, PresetFamily, ThemeEditor,
|
|
6
|
+
export { PRESET_FAMILIES, PREVIEW_SCHEMA, PresetFamily, ThemeEditor, ThemeEditorProps, ThemeEditorTheme, ThemeEditorThemeProvider, resolveThemeFromDOM, themeEditorDarkPreset, themeEditorLightPreset, useEditorTheme } from './theme-editor/index.js';
|
|
7
7
|
import '@squaredr/fieldcraft-core';
|
|
8
8
|
import 'clsx';
|
|
9
9
|
import '@dnd-kit/core';
|
package/dist/index.js
CHANGED
|
@@ -8544,6 +8544,24 @@ function ThemeEditorInner({
|
|
|
8544
8544
|
const [showComparison, setShowComparison] = react.useState(false);
|
|
8545
8545
|
const themeRef = react.useRef(theme);
|
|
8546
8546
|
themeRef.current = theme;
|
|
8547
|
+
const hasInitialTheme = react.useRef(initialTheme != null);
|
|
8548
|
+
react.useEffect(() => {
|
|
8549
|
+
if (hasInitialTheme.current) return;
|
|
8550
|
+
if (typeof window === "undefined") return;
|
|
8551
|
+
const observer = new MutationObserver(() => {
|
|
8552
|
+
requestAnimationFrame(() => {
|
|
8553
|
+
const resolved = resolveThemeFromDOM();
|
|
8554
|
+
setTheme(resolved);
|
|
8555
|
+
setPresetKey("custom");
|
|
8556
|
+
onChange?.(resolved);
|
|
8557
|
+
});
|
|
8558
|
+
});
|
|
8559
|
+
observer.observe(document.documentElement, {
|
|
8560
|
+
attributes: true,
|
|
8561
|
+
attributeFilter: ["data-theme", "class"]
|
|
8562
|
+
});
|
|
8563
|
+
return () => observer.disconnect();
|
|
8564
|
+
}, [onChange]);
|
|
8547
8565
|
react.useEffect(() => {
|
|
8548
8566
|
function handleKeyDown(e) {
|
|
8549
8567
|
if ((e.metaKey || e.ctrlKey) && e.key === "s") {
|
|
@@ -8848,7 +8866,7 @@ var themeEditorDarkPreset = {
|
|
|
8848
8866
|
// src/index.ts
|
|
8849
8867
|
if (typeof globalThis !== "undefined" && typeof globalThis.process !== "undefined" && globalThis.process.env?.NODE_ENV !== "production") {
|
|
8850
8868
|
const _fc_banner = `
|
|
8851
|
-
%c FieldCraft Pro %c v1.6.
|
|
8869
|
+
%c FieldCraft Pro %c v1.6.3
|
|
8852
8870
|
|
|
8853
8871
|
%cForm Builder \xB7 Response Viewer \xB7 Theme Editor
|
|
8854
8872
|
|
|
@@ -8878,7 +8896,6 @@ exports.ProPaymentField = ProPaymentField;
|
|
|
8878
8896
|
exports.QUESTION_TYPE_INFO = QUESTION_TYPE_INFO;
|
|
8879
8897
|
exports.ResponseViewer = ResponseViewer;
|
|
8880
8898
|
exports.ThemeEditor = ThemeEditor;
|
|
8881
|
-
exports.ThemeEditorInner = ThemeEditorInner;
|
|
8882
8899
|
exports.ThemeEditorThemeProvider = ThemeEditorThemeProvider;
|
|
8883
8900
|
exports.UnlicensedOverlay = UnlicensedOverlay;
|
|
8884
8901
|
exports.addOption = addOption;
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { DEFAULT_PALETTE, DEFAULT_SCHEMA, FormBuilder, FormBuilderThemeProvider, QUESTION_TYPE_INFO, addOption, addQuestion, addSection, duplicateQuestion, duplicateSection, findQuestion, findSection, generateId, generateOptionId, generateQuestionId, generateSectionId, moveOption, moveQuestion, moveSection, removeOption, removeQuestion, removeSection, updateOption, updateQuestion, updateSection, useBuilderState, useBuilderTheme, useDragDrop, useUndoRedo } from './chunk-ANBMT5AW.mjs';
|
|
2
2
|
export { ResponseViewer } from './chunk-5LKGCZAW.mjs';
|
|
3
3
|
export { cn } from './chunk-QQ4JZGTD.mjs';
|
|
4
|
-
export { PRESET_FAMILIES, PREVIEW_SCHEMA, ThemeEditor,
|
|
4
|
+
export { PRESET_FAMILIES, PREVIEW_SCHEMA, ThemeEditor, ThemeEditorThemeProvider, resolveThemeFromDOM, themeEditorDarkPreset, themeEditorLightPreset, useEditorTheme } from './chunk-CFVT2R42.mjs';
|
|
5
5
|
export { FieldCraftProProvider, UnlicensedOverlay, isProductionEnvironment, requireLicense, useLicense, validateLicense } from './chunk-VECQKSWS.mjs';
|
|
6
6
|
import { useState, useEffect, Suspense } from 'react';
|
|
7
7
|
import { FieldWrapper } from '@squaredr/fieldcraft-react';
|
|
@@ -277,7 +277,7 @@ var PRO_FIELD_OVERRIDES = {
|
|
|
277
277
|
// src/index.ts
|
|
278
278
|
if (typeof globalThis !== "undefined" && typeof globalThis.process !== "undefined" && globalThis.process.env?.NODE_ENV !== "production") {
|
|
279
279
|
const _fc_banner = `
|
|
280
|
-
%c FieldCraft Pro %c v1.6.
|
|
280
|
+
%c FieldCraft Pro %c v1.6.3
|
|
281
281
|
|
|
282
282
|
%cForm Builder \xB7 Response Viewer \xB7 Theme Editor
|
|
283
283
|
|
|
@@ -58,8 +58,6 @@ type ThemeEditorProps = {
|
|
|
58
58
|
|
|
59
59
|
declare const ThemeEditor: react.ComponentType<ThemeEditorProps>;
|
|
60
60
|
|
|
61
|
-
declare function ThemeEditorInner({ initialTheme, onChange, onSave, theme: chromeTheme, height, width, className, toolbarExtra, showPreview, }: ThemeEditorProps): react_jsx_runtime.JSX.Element;
|
|
62
|
-
|
|
63
61
|
declare function useEditorTheme(): ThemeEditorTheme;
|
|
64
62
|
type ThemeEditorThemeProviderProps = {
|
|
65
63
|
theme?: ThemeEditorTheme;
|
|
@@ -98,4 +96,4 @@ declare function resolveThemeFromDOM(): FormEngineTheme;
|
|
|
98
96
|
/** Compact schema used in the ThemeEditor live preview panel. */
|
|
99
97
|
declare const PREVIEW_SCHEMA: FormEngineSchema;
|
|
100
98
|
|
|
101
|
-
export { PRESET_FAMILIES, PREVIEW_SCHEMA, type PresetFamily, ThemeEditor,
|
|
99
|
+
export { PRESET_FAMILIES, PREVIEW_SCHEMA, type PresetFamily, ThemeEditor, type ThemeEditorProps, type ThemeEditorTheme, ThemeEditorThemeProvider, resolveThemeFromDOM, themeEditorDarkPreset, themeEditorLightPreset, useEditorTheme };
|
|
@@ -58,8 +58,6 @@ type ThemeEditorProps = {
|
|
|
58
58
|
|
|
59
59
|
declare const ThemeEditor: react.ComponentType<ThemeEditorProps>;
|
|
60
60
|
|
|
61
|
-
declare function ThemeEditorInner({ initialTheme, onChange, onSave, theme: chromeTheme, height, width, className, toolbarExtra, showPreview, }: ThemeEditorProps): react_jsx_runtime.JSX.Element;
|
|
62
|
-
|
|
63
61
|
declare function useEditorTheme(): ThemeEditorTheme;
|
|
64
62
|
type ThemeEditorThemeProviderProps = {
|
|
65
63
|
theme?: ThemeEditorTheme;
|
|
@@ -98,4 +96,4 @@ declare function resolveThemeFromDOM(): FormEngineTheme;
|
|
|
98
96
|
/** Compact schema used in the ThemeEditor live preview panel. */
|
|
99
97
|
declare const PREVIEW_SCHEMA: FormEngineSchema;
|
|
100
98
|
|
|
101
|
-
export { PRESET_FAMILIES, PREVIEW_SCHEMA, type PresetFamily, ThemeEditor,
|
|
99
|
+
export { PRESET_FAMILIES, PREVIEW_SCHEMA, type PresetFamily, ThemeEditor, type ThemeEditorProps, type ThemeEditorTheme, ThemeEditorThemeProvider, resolveThemeFromDOM, themeEditorDarkPreset, themeEditorLightPreset, useEditorTheme };
|
|
@@ -1372,6 +1372,24 @@ function ThemeEditorInner({
|
|
|
1372
1372
|
const [showComparison, setShowComparison] = react.useState(false);
|
|
1373
1373
|
const themeRef = react.useRef(theme);
|
|
1374
1374
|
themeRef.current = theme;
|
|
1375
|
+
const hasInitialTheme = react.useRef(initialTheme != null);
|
|
1376
|
+
react.useEffect(() => {
|
|
1377
|
+
if (hasInitialTheme.current) return;
|
|
1378
|
+
if (typeof window === "undefined") return;
|
|
1379
|
+
const observer = new MutationObserver(() => {
|
|
1380
|
+
requestAnimationFrame(() => {
|
|
1381
|
+
const resolved = resolveThemeFromDOM();
|
|
1382
|
+
setTheme(resolved);
|
|
1383
|
+
setPresetKey("custom");
|
|
1384
|
+
onChange?.(resolved);
|
|
1385
|
+
});
|
|
1386
|
+
});
|
|
1387
|
+
observer.observe(document.documentElement, {
|
|
1388
|
+
attributes: true,
|
|
1389
|
+
attributeFilter: ["data-theme", "class"]
|
|
1390
|
+
});
|
|
1391
|
+
return () => observer.disconnect();
|
|
1392
|
+
}, [onChange]);
|
|
1375
1393
|
react.useEffect(() => {
|
|
1376
1394
|
function handleKeyDown(e) {
|
|
1377
1395
|
if ((e.metaKey || e.ctrlKey) && e.key === "s") {
|
|
@@ -1676,7 +1694,6 @@ var themeEditorDarkPreset = {
|
|
|
1676
1694
|
exports.PRESET_FAMILIES = PRESET_FAMILIES;
|
|
1677
1695
|
exports.PREVIEW_SCHEMA = PREVIEW_SCHEMA;
|
|
1678
1696
|
exports.ThemeEditor = ThemeEditor;
|
|
1679
|
-
exports.ThemeEditorInner = ThemeEditorInner;
|
|
1680
1697
|
exports.ThemeEditorThemeProvider = ThemeEditorThemeProvider;
|
|
1681
1698
|
exports.resolveThemeFromDOM = resolveThemeFromDOM;
|
|
1682
1699
|
exports.themeEditorDarkPreset = themeEditorDarkPreset;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { PRESET_FAMILIES, PREVIEW_SCHEMA, ThemeEditor,
|
|
1
|
+
export { PRESET_FAMILIES, PREVIEW_SCHEMA, ThemeEditor, ThemeEditorThemeProvider, resolveThemeFromDOM, themeEditorDarkPreset, themeEditorLightPreset, useEditorTheme } from '../chunk-CFVT2R42.mjs';
|
|
2
2
|
import '../chunk-VECQKSWS.mjs';
|
package/package.json
CHANGED