@alpaca-editor/core 1.0.3953 → 1.0.3955
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/components/ActionButton.d.ts +1 -0
- package/dist/components/ActionButton.js +2 -2
- package/dist/components/ActionButton.js.map +1 -1
- package/dist/components/ui/context-menu.js +1 -1
- package/dist/components/ui/context-menu.js.map +1 -1
- package/dist/editor/ContextMenu.js +13 -3
- package/dist/editor/ContextMenu.js.map +1 -1
- package/dist/editor/Editor.d.ts +1 -1
- package/dist/editor/Editor.js +1 -1
- package/dist/editor/Editor.js.map +1 -1
- package/dist/editor/commands/componentCommands.js +1 -1
- package/dist/editor/commands/componentCommands.js.map +1 -1
- package/dist/editor/componentTreeHelper.d.ts +2 -0
- package/dist/editor/componentTreeHelper.js +34 -0
- package/dist/editor/componentTreeHelper.js.map +1 -1
- package/dist/editor/page-editor-chrome/FrameMenus.js +2 -2
- package/dist/editor/page-editor-chrome/FrameMenus.js.map +1 -1
- package/dist/editor/page-viewer/PageViewerFrame.js +2 -2
- package/dist/editor/page-viewer/PageViewerFrame.js.map +1 -1
- package/dist/editor/page-viewer/pageModelSkeletonBuilder.js +5 -8
- package/dist/editor/page-viewer/pageModelSkeletonBuilder.js.map +1 -1
- package/dist/editor/reviews/Reviews.js +43 -18
- package/dist/editor/reviews/Reviews.js.map +1 -1
- package/dist/editor/sidebar/ComponentTree.js +30 -0
- package/dist/editor/sidebar/ComponentTree.js.map +1 -1
- package/dist/editor/ui/PerfectTree.js +1 -1
- package/dist/editor/ui/PerfectTree.js.map +1 -1
- package/dist/editor/utils.d.ts +1 -0
- package/dist/editor/utils.js +11 -1
- package/dist/editor/utils.js.map +1 -1
- package/dist/revision.d.ts +2 -2
- package/dist/revision.js +2 -2
- package/dist/splash-screen/NewPage.js +1 -1
- package/dist/splash-screen/NewPage.js.map +1 -1
- package/dist/splash-screen/SplashScreen.js +1 -1
- package/dist/splash-screen/SplashScreen.js.map +1 -1
- package/dist/tour/default-tour.d.ts +1 -1
- package/dist/tour/default-tour.js +31 -33
- package/dist/tour/default-tour.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ActionButton.tsx +3 -1
- package/src/components/ui/context-menu.tsx +1 -1
- package/src/editor/ContextMenu.tsx +39 -2
- package/src/editor/Editor.tsx +2 -2
- package/src/editor/commands/componentCommands.tsx +1 -1
- package/src/editor/componentTreeHelper.tsx +43 -0
- package/src/editor/page-editor-chrome/FrameMenus.tsx +6 -7
- package/src/editor/page-viewer/PageViewerFrame.tsx +2 -2
- package/src/editor/page-viewer/pageModelSkeletonBuilder.ts +7 -9
- package/src/editor/reviews/Reviews.tsx +64 -22
- package/src/editor/sidebar/ComponentTree.tsx +44 -0
- package/src/editor/ui/PerfectTree.tsx +1 -1
- package/src/editor/utils.ts +15 -1
- package/src/revision.ts +2 -2
- package/src/splash-screen/NewPage.tsx +1 -0
- package/src/splash-screen/SplashScreen.tsx +4 -3
- package/src/tour/default-tour.tsx +30 -34
package/src/editor/utils.ts
CHANGED
|
@@ -73,6 +73,13 @@ export const useLocalStorage = <T>(
|
|
|
73
73
|
return [value, setValue];
|
|
74
74
|
};
|
|
75
75
|
|
|
76
|
+
export const extractItemIdFromItemUri = (uri: string): string => {
|
|
77
|
+
const match = uri.match(/\{[A-F0-9-]+\}/i);
|
|
78
|
+
return match
|
|
79
|
+
? match[0].replace(/[{}]/g, "").toLowerCase()
|
|
80
|
+
: uri.toLowerCase();
|
|
81
|
+
};
|
|
82
|
+
|
|
76
83
|
export function isFieldActionExecuting(
|
|
77
84
|
field: Field,
|
|
78
85
|
editContext: EditContextType,
|
|
@@ -422,6 +429,10 @@ export const getAbsolutePosition = (
|
|
|
422
429
|
|
|
423
430
|
export function findParentComponentId(element: HTMLElement) {
|
|
424
431
|
while (element && element !== document.documentElement) {
|
|
432
|
+
if (element.getAttribute("sc_item")) {
|
|
433
|
+
return extractItemIdFromItemUri(element.getAttribute("sc_item")!);
|
|
434
|
+
}
|
|
435
|
+
|
|
425
436
|
const startElement = findStartElement(element);
|
|
426
437
|
|
|
427
438
|
if (startElement) {
|
|
@@ -436,7 +447,10 @@ function findStartElement(element: HTMLElement) {
|
|
|
436
447
|
let prev: Element | null = element;
|
|
437
448
|
while (prev) {
|
|
438
449
|
prev = prev.previousElementSibling;
|
|
439
|
-
if (
|
|
450
|
+
if (
|
|
451
|
+
prev?.getAttribute("data-component-start") &&
|
|
452
|
+
!prev.hasAttribute("data-skip-component")
|
|
453
|
+
) {
|
|
440
454
|
return prev;
|
|
441
455
|
}
|
|
442
456
|
}
|
package/src/revision.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = "1.0.
|
|
2
|
-
export const buildDate = "2025-06-
|
|
1
|
+
export const version = "1.0.3955";
|
|
2
|
+
export const buildDate = "2025-06-19 14:51:54";
|
|
@@ -149,7 +149,8 @@ export function SplashScreen() {
|
|
|
149
149
|
system. It allows you to create and manage your content in a
|
|
150
150
|
simple and intuitive way.
|
|
151
151
|
<div className="flex flex-col gap-4">
|
|
152
|
-
<ActionButton
|
|
152
|
+
<ActionButton
|
|
153
|
+
id="create-new-page-button"
|
|
153
154
|
onClick={() => editContext?.switchView("new-page")}
|
|
154
155
|
>
|
|
155
156
|
Create new page
|
|
@@ -159,9 +160,9 @@ export function SplashScreen() {
|
|
|
159
160
|
>
|
|
160
161
|
Open existing page
|
|
161
162
|
</ActionButton>
|
|
162
|
-
|
|
163
|
+
<ActionButton onClick={() => editContext?.startTour()}>
|
|
163
164
|
Take tour <MagicEditIcon />
|
|
164
|
-
</ActionButton>
|
|
165
|
+
</ActionButton>
|
|
165
166
|
<ActionButton
|
|
166
167
|
onClick={() => {
|
|
167
168
|
window.open(
|
|
@@ -7,7 +7,6 @@ export function getDefaultTourSteps(
|
|
|
7
7
|
stopTour,
|
|
8
8
|
waitForElement,
|
|
9
9
|
waitForElementToDisappear,
|
|
10
|
-
setFocusRect,
|
|
11
10
|
delay,
|
|
12
11
|
waitForInput,
|
|
13
12
|
simulateTyping,
|
|
@@ -60,43 +59,23 @@ export function getDefaultTourSteps(
|
|
|
60
59
|
Click on the <b>New Page</b> tab to create a new page
|
|
61
60
|
</>
|
|
62
61
|
),
|
|
63
|
-
focusElement: "#new-page-
|
|
62
|
+
focusElement: "#create-new-page-button",
|
|
63
|
+
bubblePosition: "top-right",
|
|
64
64
|
waitForUserInput: async () => {
|
|
65
|
-
await waitForElement("
|
|
65
|
+
await waitForElement(".tour-pick-location");
|
|
66
66
|
},
|
|
67
67
|
nextStep: "pick-location",
|
|
68
68
|
},
|
|
69
69
|
"pick-location": {
|
|
70
70
|
description: (
|
|
71
71
|
<>
|
|
72
|
-
|
|
72
|
+
Open up a folder for your page
|
|
73
73
|
</>
|
|
74
74
|
),
|
|
75
|
-
focusElement: ".
|
|
75
|
+
focusElement: ".tree-container",
|
|
76
|
+
bubblePosition: "bottom",
|
|
76
77
|
waitForUserInput: async () => {
|
|
77
|
-
await
|
|
78
|
-
const checkForElement = () => {
|
|
79
|
-
const elements = document.querySelectorAll(".p-highlight");
|
|
80
|
-
for (const element of elements) {
|
|
81
|
-
if (element.textContent?.trim() === "Playground") {
|
|
82
|
-
setFocusRect(element.getBoundingClientRect());
|
|
83
|
-
resolve();
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
requestAnimationFrame(checkForElement);
|
|
88
|
-
};
|
|
89
|
-
checkForElement();
|
|
90
|
-
});
|
|
91
|
-
},
|
|
92
|
-
getPointTo: () => {
|
|
93
|
-
const elements = document.querySelectorAll(".p-treenode-label");
|
|
94
|
-
for (const element of elements) {
|
|
95
|
-
if (element.textContent?.trim() === "Playground") {
|
|
96
|
-
return element.getBoundingClientRect();
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
return undefined;
|
|
78
|
+
await waitForElement(".bg-theme-secondary-light");
|
|
100
79
|
},
|
|
101
80
|
nextStep: "choose-template",
|
|
102
81
|
},
|
|
@@ -104,7 +83,7 @@ export function getDefaultTourSteps(
|
|
|
104
83
|
description: "Select a template for your page",
|
|
105
84
|
focusElement: ".tour-choose-template",
|
|
106
85
|
waitForUserInput: async () => {
|
|
107
|
-
await waitForElement(".
|
|
86
|
+
await waitForElement(".bg-theme-secondary-light");
|
|
108
87
|
},
|
|
109
88
|
bubblePosition: "left",
|
|
110
89
|
nextStep: "enter-name",
|
|
@@ -114,15 +93,24 @@ export function getDefaultTourSteps(
|
|
|
114
93
|
focusElement: "#new-page-name",
|
|
115
94
|
bubblePosition: "left",
|
|
116
95
|
waitForUserInput: async () => {
|
|
117
|
-
await waitForElement("#create-new-page-button:not(
|
|
96
|
+
await waitForElement("#create-new-page-button:not([disabled])");
|
|
118
97
|
},
|
|
119
98
|
nextStep: "create-page",
|
|
120
99
|
},
|
|
121
100
|
"create-page": {
|
|
122
101
|
description: "Click the Create button",
|
|
123
102
|
focusElement: "#create-new-page-button",
|
|
103
|
+
bubblePosition: "bottom",
|
|
124
104
|
waitForUserInput: async () => {
|
|
125
|
-
|
|
105
|
+
// wait for loading spinner
|
|
106
|
+
await waitForElement(".pi-cog");
|
|
107
|
+
},
|
|
108
|
+
nextStep: "loading",
|
|
109
|
+
},
|
|
110
|
+
"loading": {
|
|
111
|
+
description: "Waiting for your new page...",
|
|
112
|
+
waitForUserInput: async () => {
|
|
113
|
+
await waitForElementToDisappear(".pi-cog");
|
|
126
114
|
},
|
|
127
115
|
nextStep: "ready-to-add-component",
|
|
128
116
|
},
|
|
@@ -132,16 +120,23 @@ export function getDefaultTourSteps(
|
|
|
132
120
|
{
|
|
133
121
|
label: (
|
|
134
122
|
<>
|
|
135
|
-
<i className="pi pi-arrow-right" /> I
|
|
123
|
+
<i className="pi pi-arrow-right" /> I'm ready, lets go!
|
|
136
124
|
</>
|
|
137
125
|
),
|
|
138
|
-
onClick: () =>
|
|
126
|
+
onClick: () => {
|
|
127
|
+
if (document.querySelector("#insert-component-button")) {
|
|
128
|
+
nextStep("insert-component");
|
|
129
|
+
} else {
|
|
130
|
+
nextStep("drag-component");
|
|
131
|
+
}
|
|
132
|
+
},
|
|
139
133
|
},
|
|
140
134
|
],
|
|
141
135
|
},
|
|
142
136
|
"insert-component": {
|
|
143
137
|
description: "Excellent, click on the plus button to insert a component.",
|
|
144
138
|
focusElement: "#insert-component-button",
|
|
139
|
+
bubblePosition: "bottom",
|
|
145
140
|
waitForUserInput: async () => {
|
|
146
141
|
await waitForElement(".tour-component-palette");
|
|
147
142
|
},
|
|
@@ -150,6 +145,7 @@ export function getDefaultTourSteps(
|
|
|
150
145
|
"drag-component": {
|
|
151
146
|
description: `Drag and drop a ${config.firstComponentTemplateName} component to your page.`,
|
|
152
147
|
focusElement: `#insert-component-${config.firstComponentTemplateId}`,
|
|
148
|
+
bubblePosition: "bottom",
|
|
153
149
|
waitForUserInput: async () => {
|
|
154
150
|
await waitForElement(".tour-placeholder-dropzone");
|
|
155
151
|
},
|
|
@@ -231,7 +227,7 @@ export function getDefaultTourSteps(
|
|
|
231
227
|
description: "Click on the AI sidebar to open the AI chat.",
|
|
232
228
|
focusElement: `[data-sidebarview-name='ai']`,
|
|
233
229
|
nextStep: "ai-terminal",
|
|
234
|
-
waitForElement: "[data-sidebarview-name='ai'].
|
|
230
|
+
waitForElement: "[data-sidebarview-name='ai'].active",
|
|
235
231
|
},
|
|
236
232
|
"ai-terminal": {
|
|
237
233
|
description:
|