@alpaca-editor/core 1.0.3812 → 1.0.3815
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/ui/context-menu.d.ts +25 -0
- package/dist/components/ui/context-menu.js +51 -0
- package/dist/components/ui/context-menu.js.map +1 -0
- package/dist/config/config.js +3 -2
- package/dist/config/config.js.map +1 -1
- package/dist/config/types.d.ts +4 -2
- package/dist/editor/ComponentInfo.js +1 -1
- package/dist/editor/ComponentInfo.js.map +1 -1
- package/dist/editor/ConfirmationDialog.d.ts +1 -1
- package/dist/editor/ContextMenu.d.ts +1 -1
- package/dist/editor/ContextMenu.js +24 -9
- package/dist/editor/ContextMenu.js.map +1 -1
- package/dist/editor/ImageEditor.js +2 -2
- package/dist/editor/ImageEditor.js.map +1 -1
- package/dist/editor/ItemInfo.js +2 -2
- package/dist/editor/ItemInfo.js.map +1 -1
- package/dist/editor/MainLayout.js +3 -3
- package/dist/editor/MainLayout.js.map +1 -1
- package/dist/editor/Titlebar.js +1 -1
- package/dist/editor/Titlebar.js.map +1 -1
- package/dist/editor/ai/AiTerminal.js +19 -12
- package/dist/editor/ai/AiTerminal.js.map +1 -1
- package/dist/editor/client/EditorClient.js +19 -4
- package/dist/editor/client/EditorClient.js.map +1 -1
- package/dist/editor/client/editContext.d.ts +1 -1
- package/dist/editor/client/operations.js +15 -14
- package/dist/editor/client/operations.js.map +1 -1
- package/dist/editor/client/pageModelBuilder.js +8 -5
- package/dist/editor/client/pageModelBuilder.js.map +1 -1
- package/dist/editor/commands/componentCommands.js +15 -13
- package/dist/editor/commands/componentCommands.js.map +1 -1
- package/dist/editor/componentTreeHelper.js +3 -3
- package/dist/editor/componentTreeHelper.js.map +1 -1
- package/dist/editor/control-center/ControlCenterMenu.js +3 -3
- package/dist/editor/control-center/ControlCenterMenu.js.map +1 -1
- package/dist/editor/field-types/TreeListEditor.js +4 -4
- package/dist/editor/field-types/TreeListEditor.js.map +1 -1
- package/dist/editor/page-editor-chrome/FrameMenu.js +52 -14
- package/dist/editor/page-editor-chrome/FrameMenu.js.map +1 -1
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js +5 -5
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js.map +1 -1
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.js +114 -45
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.js.map +1 -1
- package/dist/editor/page-viewer/PageViewerFrame.d.ts +0 -1
- package/dist/editor/page-viewer/PageViewerFrame.js +119 -215
- package/dist/editor/page-viewer/PageViewerFrame.js.map +1 -1
- package/dist/editor/page-viewer/pageModelBuilder.d.ts +3 -0
- package/dist/editor/page-viewer/pageModelBuilder.js +299 -0
- package/dist/editor/page-viewer/pageModelBuilder.js.map +1 -0
- package/dist/editor/pageModel.d.ts +5 -0
- package/dist/editor/sidebar/ComponentPalette.js +30 -30
- package/dist/editor/sidebar/ComponentPalette.js.map +1 -1
- package/dist/editor/sidebar/ComponentTree.js +7 -6
- package/dist/editor/sidebar/ComponentTree.js.map +1 -1
- package/dist/editor/sidebar/MainContentTree.js +1 -1
- package/dist/editor/sidebar/MainContentTree.js.map +1 -1
- package/dist/editor/sidebar/SidebarView.js +3 -3
- package/dist/editor/sidebar/SidebarView.js.map +1 -1
- package/dist/editor/ui/CopyToClipboardButton.js +2 -1
- package/dist/editor/ui/CopyToClipboardButton.js.map +1 -1
- package/dist/editor/ui/Icons.d.ts +0 -1
- package/dist/editor/ui/Icons.js +0 -3
- package/dist/editor/ui/Icons.js.map +1 -1
- package/dist/editor/ui/Section.js +1 -1
- package/dist/editor/ui/Section.js.map +1 -1
- package/dist/editor/ui/SimpleMenu.d.ts +1 -8
- package/dist/editor/ui/SimpleMenu.js +1 -1
- package/dist/editor/ui/SimpleMenu.js.map +1 -1
- package/dist/editor/utils.d.ts +2 -2
- package/dist/editor/utils.js +57 -9
- package/dist/editor/utils.js.map +1 -1
- package/dist/lib/safelist.js +1 -1
- package/dist/lib/safelist.js.map +1 -1
- package/dist/splash-screen/SplashScreen.js +0 -1
- package/dist/splash-screen/SplashScreen.js.map +1 -1
- package/dist/styles.css +242 -59
- package/dist/types.d.ts +2 -2
- package/package.json +3 -2
- package/src/components/ui/context-menu.tsx +250 -0
- package/src/config/config.tsx +2 -2
- package/src/config/types.ts +4 -2
- package/src/editor/ComponentInfo.tsx +3 -5
- package/src/editor/ConfirmationDialog.tsx +1 -1
- package/src/editor/ContextMenu.tsx +68 -19
- package/src/editor/ImageEditor.tsx +2 -2
- package/src/editor/ItemInfo.tsx +4 -4
- package/src/editor/MainLayout.tsx +3 -4
- package/src/editor/Titlebar.tsx +1 -1
- package/src/editor/ai/AiTerminal.tsx +31 -24
- package/src/editor/client/EditorClient.tsx +23 -6
- package/src/editor/client/editContext.ts +1 -1
- package/src/editor/client/operations.ts +16 -14
- package/src/editor/client/pageModelBuilder.ts +26 -18
- package/src/editor/commands/componentCommands.tsx +58 -39
- package/src/editor/componentTreeHelper.tsx +3 -2
- package/src/editor/control-center/ControlCenterMenu.tsx +4 -4
- package/src/editor/field-types/TreeListEditor.tsx +11 -11
- package/src/editor/page-editor-chrome/FrameMenu.tsx +81 -17
- package/src/editor/page-editor-chrome/InlineEditor.tsx +5 -5
- package/src/editor/page-editor-chrome/PlaceholderDropZone.tsx +12 -15
- package/src/editor/page-editor-chrome/PlaceholderDropZones.tsx +159 -68
- package/src/editor/page-viewer/PageViewerFrame.tsx +131 -300
- package/src/editor/page-viewer/pageModelBuilder.ts +412 -0
- package/src/editor/pageModel.ts +5 -0
- package/src/editor/sidebar/ComponentPalette.tsx +108 -106
- package/src/editor/sidebar/ComponentTree.tsx +10 -5
- package/src/editor/sidebar/MainContentTree.tsx +1 -1
- package/src/editor/sidebar/SidebarView.tsx +9 -9
- package/src/editor/ui/CopyToClipboardButton.tsx +2 -1
- package/src/editor/ui/Icons.tsx +0 -18
- package/src/editor/ui/Section.tsx +4 -4
- package/src/editor/ui/SimpleMenu.tsx +5 -13
- package/src/editor/utils.ts +74 -17
- package/src/lib/safelist.tsx +2 -0
- package/src/splash-screen/SplashScreen.tsx +0 -1
- package/src/types.ts +2 -4
- package/styles.css +58 -17
|
@@ -177,7 +177,7 @@ export function ComponentTree({}) {
|
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
-
if (c.
|
|
180
|
+
if (c.isShared) {
|
|
181
181
|
node.tags!.push({
|
|
182
182
|
id: "linked",
|
|
183
183
|
severity: "warning",
|
|
@@ -274,13 +274,17 @@ export function ComponentTree({}) {
|
|
|
274
274
|
};
|
|
275
275
|
|
|
276
276
|
// Handle tree context menu
|
|
277
|
-
const handleTreeContextMenu = (
|
|
278
|
-
|
|
277
|
+
const handleTreeContextMenu = (
|
|
278
|
+
node: TreeNode<Component>,
|
|
279
|
+
event: React.MouseEvent,
|
|
280
|
+
) => {
|
|
281
|
+
const componentId = nodeDictionary[node.key]?.componentId;
|
|
279
282
|
|
|
280
283
|
let selectedComponentIds = editContext?.selection || [];
|
|
281
284
|
|
|
282
285
|
if (componentId) {
|
|
283
286
|
if (selectedComponentIds.indexOf(componentId) < 0) {
|
|
287
|
+
console.log("selecting", componentId);
|
|
284
288
|
editContextRef.current?.select([componentId]);
|
|
285
289
|
selectedComponentIds = [componentId];
|
|
286
290
|
}
|
|
@@ -297,8 +301,8 @@ export function ComponentTree({}) {
|
|
|
297
301
|
.map((key) => nodeDictionary[key]!.data)
|
|
298
302
|
.filter(isDefinedEntity);
|
|
299
303
|
|
|
300
|
-
if (selectedEntities.length === 0 &&
|
|
301
|
-
selectedEntities = [
|
|
304
|
+
if (selectedEntities.length === 0 && nodeDictionary[node.key]?.data) {
|
|
305
|
+
selectedEntities = [nodeDictionary[node.key]!.data as Component];
|
|
302
306
|
}
|
|
303
307
|
|
|
304
308
|
let commands = getComponentCommands(
|
|
@@ -402,6 +406,7 @@ export function ComponentTree({}) {
|
|
|
402
406
|
expandedKeys={expandedItems}
|
|
403
407
|
onToggleExpand={handleToggle}
|
|
404
408
|
onSelect={handleTreeSelection}
|
|
409
|
+
onContextMenu={handleTreeContextMenu}
|
|
405
410
|
enableDragAndDrop={true}
|
|
406
411
|
onDragOverZone={(parent, index, event) =>
|
|
407
412
|
handleDragOverZone(parent as CustomTreeNode | null, index, event)
|
|
@@ -78,7 +78,7 @@ export function MainContentTree({
|
|
|
78
78
|
insertOptions?.find(
|
|
79
79
|
(insertOption: InsertOption) =>
|
|
80
80
|
insertOption.typeId == x.templateId ||
|
|
81
|
-
insertOption.
|
|
81
|
+
insertOption.compatibleTypeIds?.find(
|
|
82
82
|
(compatibleTemplate) => compatibleTemplate == x.templateId,
|
|
83
83
|
) !== undefined,
|
|
84
84
|
) !== undefined
|
|
@@ -19,7 +19,7 @@ export function SidebarView({
|
|
|
19
19
|
|
|
20
20
|
const [sizes, setSizes] = useState<number[]>([]);
|
|
21
21
|
const [preferredSizes, setPreferredSizes] = useState<number[] | undefined>(
|
|
22
|
-
undefined
|
|
22
|
+
undefined,
|
|
23
23
|
);
|
|
24
24
|
const [panelsExpanded, setPanelsExpanded] = useState<boolean[]>([]);
|
|
25
25
|
const [sizeToSet, setSizeToSet] = useState<number[] | undefined>();
|
|
@@ -76,8 +76,8 @@ export function SidebarView({
|
|
|
76
76
|
return (
|
|
77
77
|
<div
|
|
78
78
|
className={classNames(
|
|
79
|
-
"
|
|
80
|
-
panelsExpanded[index] ? "border-b border-gray-200" : ""
|
|
79
|
+
"justify relative flex cursor-pointer items-center bg-gray-50 p-2.5 text-xs text-gray-500 uppercase",
|
|
80
|
+
panelsExpanded[index] ? "border-b border-gray-200" : "",
|
|
81
81
|
)}
|
|
82
82
|
onClick={() => toggle(index)}
|
|
83
83
|
>
|
|
@@ -85,13 +85,13 @@ export function SidebarView({
|
|
|
85
85
|
(typeof panel.icon === "string" ? (
|
|
86
86
|
<i className={classNames(panel.icon, "pi mr-1.5")}></i>
|
|
87
87
|
) : (
|
|
88
|
-
<div className="
|
|
88
|
+
<div className="mr-2 h-4 w-4">{panel.icon}</div>
|
|
89
89
|
))}
|
|
90
90
|
<div className="mr-auto">{panel.title}</div>
|
|
91
91
|
<i
|
|
92
92
|
className={classNames(
|
|
93
93
|
panelsExpanded[index] ? "pi-chevron-up" : "pi-chevron-down",
|
|
94
|
-
"pi text-sm"
|
|
94
|
+
"pi text-sm",
|
|
95
95
|
)}
|
|
96
96
|
></i>
|
|
97
97
|
</div>
|
|
@@ -128,14 +128,14 @@ export function SidebarView({
|
|
|
128
128
|
: panelHeaderSize
|
|
129
129
|
}
|
|
130
130
|
>
|
|
131
|
-
<div className="flex flex-col
|
|
131
|
+
<div className="flex h-full flex-col">
|
|
132
132
|
{getHeader(panel, index)}
|
|
133
133
|
{panelsExpanded[index] && (
|
|
134
|
-
<div className="
|
|
134
|
+
<div className="relative flex-1 overflow-hidden">
|
|
135
135
|
<div
|
|
136
136
|
className={classNames(
|
|
137
|
-
"inset-0
|
|
138
|
-
panel.noOverflow ? "" : "overflow-y-auto"
|
|
137
|
+
"absolute inset-0",
|
|
138
|
+
panel.noOverflow ? "" : "overflow-y-auto",
|
|
139
139
|
)}
|
|
140
140
|
>
|
|
141
141
|
{panel.content}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
+
import { Copy } from "lucide-react";
|
|
3
4
|
import { useEditContext } from "../client/editContext";
|
|
4
5
|
|
|
5
6
|
export function CopyToClipboardButton({ text }: { text: string }) {
|
|
@@ -17,7 +18,7 @@ export function CopyToClipboardButton({ text }: { text: string }) {
|
|
|
17
18
|
className="ml-1 cursor-pointer"
|
|
18
19
|
onClick={() => handleCopyToClipboard(text)}
|
|
19
20
|
>
|
|
20
|
-
<
|
|
21
|
+
<Copy size={14} />
|
|
21
22
|
</span>
|
|
22
23
|
);
|
|
23
24
|
}
|
package/src/editor/ui/Icons.tsx
CHANGED
|
@@ -310,24 +310,6 @@ export function PuzzleIcon() {
|
|
|
310
310
|
);
|
|
311
311
|
}
|
|
312
312
|
|
|
313
|
-
export function NavigatorIcon() {
|
|
314
|
-
return (
|
|
315
|
-
<svg
|
|
316
|
-
width="18"
|
|
317
|
-
height="16"
|
|
318
|
-
viewBox="0 0 16 14"
|
|
319
|
-
fill="none"
|
|
320
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
321
|
-
stroke="currentColor"
|
|
322
|
-
>
|
|
323
|
-
<path
|
|
324
|
-
d="M8.27572 8.58057L0.942383 4.58057L8.27572 0.580566L15.609 4.58057L8.27572 8.58057ZM8.27572 11.2472L1.32572 7.4639L2.72572 6.69723L8.27572 9.73057L13.8257 6.69723L15.2257 7.4639L8.27572 11.2472ZM8.27572 13.9139L1.32572 10.1306L2.72572 9.3639L8.27572 12.3972L13.8257 9.3639L15.2257 10.1306L8.27572 13.9139ZM8.27572 7.0639L12.8257 4.58057L8.27572 2.09723L3.72572 4.58057L8.27572 7.0639Z"
|
|
325
|
-
fill="#6b7280"
|
|
326
|
-
/>
|
|
327
|
-
</svg>
|
|
328
|
-
);
|
|
329
|
-
}
|
|
330
|
-
|
|
331
313
|
export function FormEditIcon({ className }: { className?: string }) {
|
|
332
314
|
return (
|
|
333
315
|
<svg
|
|
@@ -16,8 +16,8 @@ export function Section({
|
|
|
16
16
|
className={classNames(
|
|
17
17
|
open
|
|
18
18
|
? "border-blue-500 bg-gray-600"
|
|
19
|
-
: "border-gray-400 bg-gray-400 hover:
|
|
20
|
-
"
|
|
19
|
+
: "border-gray-400 bg-gray-400 hover:border-gray-300 hover:bg-gray-500",
|
|
20
|
+
"flex cursor-pointer items-center justify-between border-l-[8px] px-3 py-2 text-xs text-white",
|
|
21
21
|
)}
|
|
22
22
|
onClick={() => setOpen(!open)}
|
|
23
23
|
>
|
|
@@ -25,11 +25,11 @@ export function Section({
|
|
|
25
25
|
<i
|
|
26
26
|
className={classNames(
|
|
27
27
|
open ? "pi-chevron-up" : "pi-chevron-down",
|
|
28
|
-
"pi cursor-pointer text-xs"
|
|
28
|
+
"pi cursor-pointer text-xs",
|
|
29
29
|
)}
|
|
30
30
|
></i>
|
|
31
31
|
</div>
|
|
32
|
-
{open && <div className="
|
|
32
|
+
{open && <div className="bg-gray-50 px-2 pt-4 pb-6">{children}</div>}
|
|
33
33
|
</div>
|
|
34
34
|
);
|
|
35
35
|
}
|
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
export type MenuItem = {
|
|
4
|
-
key: string;
|
|
5
|
-
label: string;
|
|
6
|
-
items?: MenuItem[];
|
|
7
|
-
icon?: ReactNode;
|
|
8
|
-
command?: () => void;
|
|
9
|
-
};
|
|
10
|
-
|
|
2
|
+
import { MenuItem } from "../../config/types";
|
|
11
3
|
export function SimpleMenu({
|
|
12
4
|
items,
|
|
13
5
|
activeItemKey,
|
|
@@ -18,9 +10,9 @@ export function SimpleMenu({
|
|
|
18
10
|
onItemClick: (item: MenuItem) => void;
|
|
19
11
|
}) {
|
|
20
12
|
return (
|
|
21
|
-
<div className="flex flex-col p-1
|
|
13
|
+
<div className="flex h-full flex-col p-1">
|
|
22
14
|
{items.map((item, index) => (
|
|
23
|
-
<div key={index} className="
|
|
15
|
+
<div key={index} className="flex h-full flex-col gap-1 p-2">
|
|
24
16
|
<div className="flex flex-row items-center gap-2 border-b border-gray-200 pb-1 pl-2">
|
|
25
17
|
{item.icon && item.icon}
|
|
26
18
|
{item.label}
|
|
@@ -28,8 +20,8 @@ export function SimpleMenu({
|
|
|
28
20
|
{item.items?.map((subItem, subIndex) => (
|
|
29
21
|
<div
|
|
30
22
|
key={subIndex}
|
|
31
|
-
className={`flex flex-col
|
|
32
|
-
activeItemKey === subItem.
|
|
23
|
+
className={`flex cursor-pointer flex-col p-1 px-4 hover:bg-gray-100 ${
|
|
24
|
+
activeItemKey === subItem.id ? "bg-gray-100" : ""
|
|
33
25
|
}`}
|
|
34
26
|
onClick={() => {
|
|
35
27
|
onItemClick(subItem);
|
package/src/editor/utils.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { useEffect, useRef } from "react";
|
|
|
4
4
|
import { EditContextType } from "./client/editContext";
|
|
5
5
|
|
|
6
6
|
import { FieldDescriptor } from "../types";
|
|
7
|
-
import { Field, FullItem, ItemDescriptor } from "./pageModel";
|
|
7
|
+
import { Field, FullItem, ItemDescriptor, Component } from "./pageModel";
|
|
8
8
|
|
|
9
9
|
export type Rect = {
|
|
10
10
|
x: number;
|
|
@@ -284,31 +284,19 @@ export function findFieldElement(
|
|
|
284
284
|
|
|
285
285
|
export function findComponentRect(
|
|
286
286
|
iframe: HTMLIFrameElement,
|
|
287
|
-
|
|
287
|
+
component: Component,
|
|
288
288
|
takeScrollPositionIntoAccount = false,
|
|
289
289
|
) {
|
|
290
290
|
if (!iframe.contentWindow?.document.body) return undefined;
|
|
291
291
|
|
|
292
|
-
|
|
293
|
-
"[data-component-start='" + componentId + "']",
|
|
294
|
-
);
|
|
295
|
-
|
|
296
|
-
const componentEnd = iframe?.contentWindow?.document.body.querySelector(
|
|
297
|
-
"[data-component-end='" + componentId + "']",
|
|
298
|
-
);
|
|
299
|
-
|
|
300
|
-
if (!componentStart || !componentEnd) {
|
|
301
|
-
return null;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
let startElement = componentStart.nextElementSibling;
|
|
292
|
+
let startElement: Element | undefined | null = component.firstDOMElement;
|
|
305
293
|
|
|
306
294
|
while (startElement && startElement.tagName === "SCRIPT") {
|
|
307
295
|
startElement = startElement.nextElementSibling;
|
|
308
296
|
}
|
|
309
297
|
|
|
310
298
|
if (!startElement) {
|
|
311
|
-
console.error("No start element found for component " +
|
|
299
|
+
console.error("No start element found for component " + component.id);
|
|
312
300
|
return null;
|
|
313
301
|
}
|
|
314
302
|
|
|
@@ -316,12 +304,13 @@ export function findComponentRect(
|
|
|
316
304
|
? getAbsolutePosition(startElement as HTMLElement, iframe)
|
|
317
305
|
: startElement.getBoundingClientRect();
|
|
318
306
|
|
|
319
|
-
let endElement =
|
|
307
|
+
let endElement: Element | undefined | null = component.lastDOMElement;
|
|
320
308
|
|
|
321
309
|
while (endElement && endElement.tagName === "SCRIPT") {
|
|
322
310
|
endElement = endElement.previousElementSibling;
|
|
323
311
|
}
|
|
324
312
|
|
|
313
|
+
|
|
325
314
|
if (!endElement) return null;
|
|
326
315
|
|
|
327
316
|
const endRect = takeScrollPositionIntoAccount
|
|
@@ -350,6 +339,74 @@ export function findComponentRect(
|
|
|
350
339
|
};
|
|
351
340
|
}
|
|
352
341
|
|
|
342
|
+
// export function findComponentRect(
|
|
343
|
+
// iframe: HTMLIFrameElement,
|
|
344
|
+
// componentId: string,
|
|
345
|
+
// takeScrollPositionIntoAccount = false,
|
|
346
|
+
// ) {
|
|
347
|
+
// if (!iframe.contentWindow?.document.body) return undefined;
|
|
348
|
+
|
|
349
|
+
// const componentStart = iframe.contentWindow?.document.body.querySelector(
|
|
350
|
+
// "[data-component-start='" + componentId + "']",
|
|
351
|
+
// );
|
|
352
|
+
|
|
353
|
+
// const componentEnd = iframe?.contentWindow?.document.body.querySelector(
|
|
354
|
+
// "[data-component-end='" + componentId + "']",
|
|
355
|
+
// );
|
|
356
|
+
|
|
357
|
+
// if (!componentStart || !componentEnd) {
|
|
358
|
+
// return null;
|
|
359
|
+
// }
|
|
360
|
+
|
|
361
|
+
// let startElement = componentStart.nextElementSibling;
|
|
362
|
+
|
|
363
|
+
// while (startElement && startElement.tagName === "SCRIPT") {
|
|
364
|
+
// startElement = startElement.nextElementSibling;
|
|
365
|
+
// }
|
|
366
|
+
|
|
367
|
+
// if (!startElement) {
|
|
368
|
+
// console.error("No start element found for component " + componentId);
|
|
369
|
+
// return null;
|
|
370
|
+
// }
|
|
371
|
+
|
|
372
|
+
// const startRect = takeScrollPositionIntoAccount
|
|
373
|
+
// ? getAbsolutePosition(startElement as HTMLElement, iframe)
|
|
374
|
+
// : startElement.getBoundingClientRect();
|
|
375
|
+
|
|
376
|
+
// let endElement = componentEnd.previousElementSibling;
|
|
377
|
+
|
|
378
|
+
// while (endElement && endElement.tagName === "SCRIPT") {
|
|
379
|
+
// endElement = endElement.previousElementSibling;
|
|
380
|
+
// }
|
|
381
|
+
|
|
382
|
+
// if (!endElement) return null;
|
|
383
|
+
|
|
384
|
+
// const endRect = takeScrollPositionIntoAccount
|
|
385
|
+
// ? getAbsolutePosition(endElement as HTMLElement, iframe)
|
|
386
|
+
// : endElement.getBoundingClientRect();
|
|
387
|
+
|
|
388
|
+
// const elements =
|
|
389
|
+
// startElement === endElement ? [startElement] : [startElement, endElement];
|
|
390
|
+
|
|
391
|
+
// // console.log(
|
|
392
|
+
// // "start rect",
|
|
393
|
+
// // startRect,
|
|
394
|
+
// // startElement,
|
|
395
|
+
// // iframe.contentWindow?.scrollY,
|
|
396
|
+
// // takeScrollPositionIntoAccount
|
|
397
|
+
// // );
|
|
398
|
+
|
|
399
|
+
// return {
|
|
400
|
+
// rect: {
|
|
401
|
+
// x: startRect.x,
|
|
402
|
+
// y: startRect.y,
|
|
403
|
+
// width: endRect.x + endRect.width - startRect.x,
|
|
404
|
+
// height: endRect.y + endRect.height - startRect.y,
|
|
405
|
+
// },
|
|
406
|
+
// elements: elements,
|
|
407
|
+
// };
|
|
408
|
+
// }
|
|
409
|
+
|
|
353
410
|
export const getAbsolutePosition = (
|
|
354
411
|
element: HTMLElement,
|
|
355
412
|
iframe: HTMLIFrameElement,
|
package/src/lib/safelist.tsx
CHANGED
|
@@ -4,9 +4,11 @@ export function Safelist() {
|
|
|
4
4
|
<div className="bg-orange-400"></div>
|
|
5
5
|
<div className="bg-purple-400"></div>
|
|
6
6
|
<div className="bg-sky-400"></div>
|
|
7
|
+
<div className="bg-red-400"></div>
|
|
7
8
|
<div className="border-orange-400"></div>
|
|
8
9
|
<div className="border-purple-400"></div>
|
|
9
10
|
<div className="border-sky-400"></div>
|
|
11
|
+
<div className="border-red-400"></div>
|
|
10
12
|
</>
|
|
11
13
|
);
|
|
12
14
|
}
|
package/src/types.ts
CHANGED
|
@@ -93,7 +93,7 @@ export type RenameItemOperation = EditOperation & {
|
|
|
93
93
|
|
|
94
94
|
export type EditFieldOperation = EditOperation & {
|
|
95
95
|
type: "edit-field";
|
|
96
|
-
|
|
96
|
+
itemId: string;
|
|
97
97
|
fieldName: string;
|
|
98
98
|
fieldId: string;
|
|
99
99
|
fieldType?: string;
|
|
@@ -214,7 +214,7 @@ export type InsertOption = {
|
|
|
214
214
|
isInvalid: boolean;
|
|
215
215
|
message?: string;
|
|
216
216
|
isHidden: any;
|
|
217
|
-
|
|
217
|
+
compatibleTypeIds?: string[];
|
|
218
218
|
};
|
|
219
219
|
|
|
220
220
|
export type LanguagesAndVersions = {
|
|
@@ -296,7 +296,5 @@ export type SystemStatusMessage = {
|
|
|
296
296
|
};
|
|
297
297
|
|
|
298
298
|
export type SystemStatus = {
|
|
299
|
-
|
|
300
299
|
messages: SystemStatusMessage[];
|
|
301
300
|
};
|
|
302
|
-
|
package/styles.css
CHANGED
|
@@ -15,37 +15,74 @@
|
|
|
15
15
|
--animate-fadeRight: "fadeRight 0.8s ease-in-out";
|
|
16
16
|
--animate-bounceDots: "bounceDots .6s infinite alternate";
|
|
17
17
|
|
|
18
|
-
|
|
19
18
|
@keyframes sparkle {
|
|
20
|
-
"0%, 100%": {
|
|
21
|
-
|
|
19
|
+
"0%, 100%": {
|
|
20
|
+
opacity: 0.8;
|
|
21
|
+
transform: scale(1);
|
|
22
|
+
}
|
|
23
|
+
"50%": {
|
|
24
|
+
opacity: 1;
|
|
25
|
+
transform: scale(1.3);
|
|
26
|
+
}
|
|
22
27
|
}
|
|
23
28
|
@keyframes slideUp {
|
|
24
|
-
"0%": {
|
|
25
|
-
|
|
29
|
+
"0%": {
|
|
30
|
+
transform: translateY(70px);
|
|
31
|
+
opacity: 0;
|
|
32
|
+
}
|
|
33
|
+
"100%": {
|
|
34
|
+
transform: translateY(0);
|
|
35
|
+
opacity: 1;
|
|
36
|
+
}
|
|
26
37
|
}
|
|
27
38
|
@keyframes fadeIn {
|
|
28
|
-
"0%": {
|
|
29
|
-
|
|
39
|
+
"0%": {
|
|
40
|
+
opacity: 0;
|
|
41
|
+
}
|
|
42
|
+
"100%": {
|
|
43
|
+
opacity: 1;
|
|
44
|
+
}
|
|
30
45
|
}
|
|
31
46
|
@keyframes fadeLeft {
|
|
32
|
-
"0%": {
|
|
33
|
-
|
|
47
|
+
"0%": {
|
|
48
|
+
transform: translateX(-50%);
|
|
49
|
+
opacity: 0;
|
|
50
|
+
}
|
|
51
|
+
"100%": {
|
|
52
|
+
transform: translateX(0);
|
|
53
|
+
opacity: 1;
|
|
54
|
+
}
|
|
34
55
|
}
|
|
35
56
|
@keyframes fadeRight {
|
|
36
|
-
"0%": {
|
|
37
|
-
|
|
57
|
+
"0%": {
|
|
58
|
+
transform: translateX(50%);
|
|
59
|
+
opacity: 0;
|
|
60
|
+
}
|
|
61
|
+
"100%": {
|
|
62
|
+
transform: translateX(0);
|
|
63
|
+
opacity: 1;
|
|
64
|
+
}
|
|
38
65
|
}
|
|
39
66
|
@keyframes fadeBottom {
|
|
40
|
-
"0%": {
|
|
41
|
-
|
|
67
|
+
"0%": {
|
|
68
|
+
transform: translateY(50%);
|
|
69
|
+
opacity: 0;
|
|
70
|
+
}
|
|
71
|
+
"100%": {
|
|
72
|
+
transform: translateY(0);
|
|
73
|
+
opacity: 1;
|
|
74
|
+
}
|
|
42
75
|
}
|
|
43
76
|
@keyframes bounceDots {
|
|
44
|
-
"0%": {
|
|
45
|
-
|
|
77
|
+
"0%": {
|
|
78
|
+
opacity: 1;
|
|
79
|
+
transform: translateY(0);
|
|
80
|
+
}
|
|
81
|
+
"100%": {
|
|
82
|
+
opacity: 0.3;
|
|
83
|
+
transform: translateY(-2px);
|
|
84
|
+
}
|
|
46
85
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
86
|
}
|
|
50
87
|
|
|
51
88
|
:root {
|
|
@@ -641,3 +678,7 @@
|
|
|
641
678
|
width: 15px;
|
|
642
679
|
height: 15px;
|
|
643
680
|
}
|
|
681
|
+
|
|
682
|
+
button {
|
|
683
|
+
cursor: pointer;
|
|
684
|
+
}
|