@developer_tribe/react-builder 1.2.35 → 1.2.36
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/RenderPage.d.ts +0 -12
- package/dist/attributes-editor/Field.d.ts +2 -1
- package/dist/attributes-editor/SizeField.d.ts +2 -1
- package/dist/attributes-editor/attributesEditorUtils.d.ts +2 -1
- package/dist/build-components/BIcon/BIcon.d.ts +0 -3
- package/dist/build-components/BIcon/BIconProps.generated.d.ts +1 -0
- package/dist/build-components/Button/Button.d.ts +0 -3
- package/dist/build-components/CarouselItem/CarouselItem.d.ts +0 -3
- package/dist/build-components/CountDown/CountDownProps.generated.d.ts +1 -1
- package/dist/build-components/OnboardButton/OnboardButton.d.ts +0 -3
- package/dist/build-components/OnboardDot/OnboardDot.d.ts +0 -3
- package/dist/build-components/OnboardFooter/OnboardFooterProps.generated.d.ts +1 -0
- package/dist/build-components/OnboardItem/OnboardItemProps.generated.d.ts +0 -3
- package/dist/build-components/OnboardSubtitle/OnboardSubtitleProps.generated.d.ts +1 -0
- package/dist/build-components/OnboardTitle/OnboardTitleProps.generated.d.ts +1 -0
- package/dist/build-components/PaywallCloseButton/PaywallCloseButton.d.ts +0 -3
- package/dist/build-components/PaywallCloseButton/PaywallCloseButtonProps.generated.d.ts +1 -0
- package/dist/build-components/PriceTag/PriceTagProps.generated.d.ts +1 -0
- package/dist/build-components/Pricing/PricingProps.generated.d.ts +1 -0
- package/dist/build-components/Promo/PromoProps.generated.d.ts +1 -0
- package/dist/build-components/Text/TextProps.generated.d.ts +1 -0
- package/dist/build-components/patterns.generated.d.ts +9798 -10468
- package/dist/components/Breadcrumb.d.ts +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.web.cjs.js +3 -3
- package/dist/index.web.cjs.js.map +1 -1
- package/dist/index.web.esm.js +3 -3
- package/dist/index.web.esm.js.map +1 -1
- package/dist/migrations/migratePipe.d.ts +2 -1
- package/dist/migrations/semver.d.ts +0 -7
- package/dist/pages/DebugJsonPage.d.ts +2 -1
- package/dist/pages/ProjectDebug.d.ts +2 -1
- package/dist/pages/ProjectMigrationPage.d.ts +2 -1
- package/dist/pages/ProjectPage.d.ts +2 -1
- package/dist/pages/ProjectValidationPage.d.ts +2 -1
- package/dist/pages/tabs/SideTool.d.ts +0 -7
- package/dist/utils/parseColor.d.ts +1 -1
- package/package.json +1 -1
- package/scripts/prebuild/assets/prompt_scheme.md +5 -11
- package/scripts/prebuild/generate-prompt-schemes.js +11 -8
- package/scripts/prebuild/utils/validateAllComponentsOrThrow.js +50 -0
- package/scripts/prebuild/utils/validatePatternJson.js +73 -0
- package/src/RenderPage.tsx +1 -7
- package/src/assets/meta.json +1 -1
- package/src/assets/prompt-scheme-onboard.generated.ts +1 -1
- package/src/assets/prompt-scheme-paywall.generated.ts +1 -1
- package/src/attributes-editor/Field.tsx +1 -1
- package/src/attributes-editor/SizeField.tsx +1 -1
- package/src/attributes-editor/attributesEditorUtils.ts +1 -1
- package/src/attributes-editor/useAttributesEditorModel.ts +5 -1
- package/src/build-components/BIcon/BIcon.tsx +0 -2
- package/src/build-components/BIcon/BIconProps.generated.ts +1 -0
- package/src/build-components/BackgroundImage/pattern.json +8 -9
- package/src/build-components/Button/Button.tsx +0 -2
- package/src/build-components/CarouselDots/CarouselDots.tsx +1 -1
- package/src/build-components/CarouselDots/pattern.json +1 -1
- package/src/build-components/CarouselItem/CarouselItem.tsx +0 -2
- package/src/build-components/CountDown/CountDownProps.generated.ts +1 -1
- package/src/build-components/OnboardButton/OnboardButton.tsx +1 -4
- package/src/build-components/OnboardButtons/pattern.json +2 -4
- package/src/build-components/OnboardDot/OnboardDot.tsx +0 -2
- package/src/build-components/OnboardDot/pattern.json +0 -1
- package/src/build-components/OnboardFooter/OnboardFooter.tsx +4 -4
- package/src/build-components/OnboardFooter/OnboardFooterProps.generated.ts +1 -0
- package/src/build-components/OnboardItem/OnboardItemProps.generated.ts +0 -3
- package/src/build-components/OnboardItem/pattern.json +27 -23
- package/src/build-components/OnboardProvider/pattern.json +29 -27
- package/src/build-components/OnboardSubtitle/OnboardSubtitleProps.generated.ts +1 -0
- package/src/build-components/OnboardTitle/OnboardTitleProps.generated.ts +1 -0
- package/src/build-components/PaywallCloseButton/PaywallCloseButton.tsx +0 -2
- package/src/build-components/PaywallCloseButton/PaywallCloseButtonProps.generated.ts +1 -0
- package/src/build-components/PriceTag/PriceTagProps.generated.ts +1 -0
- package/src/build-components/Pricing/PricingProps.generated.ts +1 -0
- package/src/build-components/Promo/PromoProps.generated.ts +1 -0
- package/src/build-components/RadioButton/pattern.json +2 -4
- package/src/build-components/Separator/pattern.json +24 -24
- package/src/build-components/Text/TextProps.generated.ts +1 -0
- package/src/build-components/Text/pattern.json +2 -1
- package/src/build-components/View/pattern.json +265 -265
- package/src/build-components/patterns.generated.ts +10019 -10689
- package/src/components/Breadcrumb.tsx +1 -1
- package/src/migrations/migratePipe.ts +1 -1
- package/src/migrations/semver.ts +3 -3
- package/src/modals/MockableFeatureModal.tsx +3 -1
- package/src/modals/PromptManagerModal.tsx +1 -7
- package/src/pages/DebugJsonPage.tsx +1 -1
- package/src/pages/ProjectDebug.tsx +1 -1
- package/src/pages/ProjectMigrationPage.tsx +1 -1
- package/src/pages/ProjectPage.tsx +1 -1
- package/src/pages/ProjectValidationPage.tsx +1 -1
- package/src/pages/tabs/SideTool.tsx +1 -1
- package/src/utils/nodeXml.ts +2 -4
- package/src/utils/parseColor.ts +5 -6
package/src/migrations/semver.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
type Semver = { major: number; minor: number; patch: number };
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
function parseSemver(input?: string | null): Semver {
|
|
4
4
|
const raw = typeof input === 'string' ? input.trim() : '';
|
|
5
5
|
const [maj, min, pat] = raw.split('.').slice(0, 3);
|
|
6
6
|
const toNum = (v?: string) => {
|
|
@@ -10,7 +10,7 @@ export function parseSemver(input?: string | null): Semver {
|
|
|
10
10
|
return { major: toNum(maj), minor: toNum(min), patch: toNum(pat) };
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
function compareSemver(a: string, b: string): number {
|
|
14
14
|
const A = parseSemver(a);
|
|
15
15
|
const B = parseSemver(b);
|
|
16
16
|
if (A.major !== B.major) return A.major < B.major ? -1 : 1;
|
|
@@ -371,7 +371,9 @@ export function MockableFeatureModal({
|
|
|
371
371
|
/>
|
|
372
372
|
</div>
|
|
373
373
|
<p style={{ margin: '8px 0 0', opacity: 0.7, fontSize: 12 }}>
|
|
374
|
-
No mock UI yet for "
|
|
374
|
+
No mock UI yet for {'"'}
|
|
375
|
+
{featureKey}
|
|
376
|
+
{'"'} — import via JSON.
|
|
375
377
|
</p>
|
|
376
378
|
</>
|
|
377
379
|
)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
2
2
|
import Modal from './Modal';
|
|
3
3
|
import { useRenderStore } from '../store';
|
|
4
4
|
import type { Node } from '../types/Node';
|
|
@@ -102,12 +102,6 @@ function XmlEditorTab({
|
|
|
102
102
|
setApplySuccess(false);
|
|
103
103
|
}, [initialXml]);
|
|
104
104
|
|
|
105
|
-
const handleChange = useCallback((value: string) => {
|
|
106
|
-
setText(value);
|
|
107
|
-
setApplyError(null);
|
|
108
|
-
setApplySuccess(false);
|
|
109
|
-
}, []);
|
|
110
|
-
|
|
111
105
|
const handleApply = () => {
|
|
112
106
|
try {
|
|
113
107
|
const parsed = xmlToNode(text);
|
|
@@ -3,7 +3,7 @@ import type { Product } from '../paywall/types/paywall-types';
|
|
|
3
3
|
import type { PaywallBenefits } from '../paywall/types/benefits';
|
|
4
4
|
import { ProjectDebug } from './ProjectDebug';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
type ProjectMigrationPageProps = {
|
|
7
7
|
name: string;
|
|
8
8
|
rawData: unknown;
|
|
9
9
|
|
|
@@ -36,7 +36,7 @@ import { useProjectFonts } from '../hooks/useProjectFonts';
|
|
|
36
36
|
import { resolveProjectForSave, toProjectMeta } from './projectPageUtils';
|
|
37
37
|
import { getDefaultProject } from '../utils/getDefaultProject';
|
|
38
38
|
import { CURRENT_PROJECT_VERSION } from '../migrations/migratePipe';
|
|
39
|
-
|
|
39
|
+
type ProjectPageProps = {
|
|
40
40
|
project: Project;
|
|
41
41
|
// TODO: Tüm onSaveProject call-site'ları toProjectMeta kullanacak şekilde migrate et
|
|
42
42
|
onSaveProject: (project: ProjectMeta) => void;
|
|
@@ -6,7 +6,7 @@ import { safeJsonStringify } from '../utils/safeJsonStringify';
|
|
|
6
6
|
import type { Node } from '../types/Node';
|
|
7
7
|
import { wrapNodeInMain } from '../utils/wrapNodeInMain';
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
type ProjectValidationPageProps = {
|
|
10
10
|
name: string;
|
|
11
11
|
rawData: unknown;
|
|
12
12
|
validationError: string;
|
|
@@ -13,7 +13,7 @@ type SideToolProps = {
|
|
|
13
13
|
setData: React.Dispatch<React.SetStateAction<Node>>;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
function SideTool({ data, setData }: SideToolProps) {
|
|
17
17
|
useLogRender('SideTool');
|
|
18
18
|
const [isDebugModalOpen, setIsDebugModalOpen] = useState(false);
|
|
19
19
|
const [isLocalicationModalOpen, setIsLocalicationModalOpen] = useState(false);
|
package/src/utils/nodeXml.ts
CHANGED
|
@@ -135,8 +135,7 @@ function domElementToNode(el: Element): NodeData {
|
|
|
135
135
|
const reserved = new Set(['key', 'sourceType', 'isMain']);
|
|
136
136
|
const attributes: Record<string, unknown> = {};
|
|
137
137
|
|
|
138
|
-
for (
|
|
139
|
-
const attr = el.attributes[i];
|
|
138
|
+
for (const attr of Array.from(el.attributes)) {
|
|
140
139
|
if (reserved.has(attr.name)) {
|
|
141
140
|
if (attr.name === 'key') nodeData.key = attr.value;
|
|
142
141
|
else if (attr.name === 'sourceType') nodeData.sourceType = attr.value;
|
|
@@ -152,8 +151,7 @@ function domElementToNode(el: Element): NodeData {
|
|
|
152
151
|
|
|
153
152
|
// Children
|
|
154
153
|
const childNodes: Node[] = [];
|
|
155
|
-
for (
|
|
156
|
-
const child = el.childNodes[i];
|
|
154
|
+
for (const child of Array.from(el.childNodes)) {
|
|
157
155
|
if (child.nodeType === 1) {
|
|
158
156
|
// Element
|
|
159
157
|
childNodes.push(domElementToNode(child as Element));
|
package/src/utils/parseColor.ts
CHANGED
|
@@ -14,28 +14,27 @@ export function parseColor(value?: string, options: ParseColorOptions = {}) {
|
|
|
14
14
|
if (!trimmed) return undefined;
|
|
15
15
|
|
|
16
16
|
const { projectColors, theme } = options;
|
|
17
|
-
if (!projectColors) return trimmed;
|
|
18
17
|
|
|
19
18
|
if (trimmed.startsWith(STATIC_PREFIX)) {
|
|
20
19
|
const token = trimmed.slice(STATIC_PREFIX.length);
|
|
21
|
-
const resolved = projectColors
|
|
20
|
+
const resolved = projectColors?.STATIC_COLORS?.[token];
|
|
22
21
|
return typeof resolved === 'string' && resolved.trim()
|
|
23
22
|
? resolved.trim()
|
|
24
|
-
:
|
|
23
|
+
: null;
|
|
25
24
|
}
|
|
26
25
|
|
|
27
26
|
if (trimmed.startsWith(THEME_PREFIX)) {
|
|
28
27
|
const token = trimmed.slice(THEME_PREFIX.length);
|
|
29
|
-
if (!token) return
|
|
28
|
+
if (!token) return null;
|
|
30
29
|
|
|
31
30
|
const resolvedTheme = theme ?? 'light';
|
|
32
|
-
const themeTokens = projectColors
|
|
31
|
+
const themeTokens = projectColors?.THEME_COLORS?.[resolvedTheme];
|
|
33
32
|
const resolved = themeTokens?.[token];
|
|
34
33
|
if (typeof resolved === 'string' && resolved.trim()) {
|
|
35
34
|
return resolved.trim();
|
|
36
35
|
}
|
|
37
36
|
|
|
38
|
-
return
|
|
37
|
+
return null;
|
|
39
38
|
}
|
|
40
39
|
|
|
41
40
|
return trimmed;
|