@reacteditor/core 0.0.4 → 0.0.6
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/Editor-4LPVLYSU.css +415 -0
- package/dist/{Editor-2TYODRQT.mjs → Editor-YNFB7B6Z.mjs} +8 -8
- package/dist/{Render-VDC7AEQK.mjs → Render-STFB5CNO.mjs} +1 -1
- package/dist/Render-ZTUTUUAH.css +103 -0
- package/dist/{actions-BCDhqbeL.d.mts → actions-CQmL3wwa.d.mts} +11 -6
- package/dist/{actions-BCDhqbeL.d.ts → actions-CQmL3wwa.d.ts} +11 -6
- package/dist/{chunk-VD3EVRUF.mjs → chunk-275EJPEB.mjs} +2 -2
- package/dist/{chunk-ZHNRSSMW.mjs → chunk-6LG4Q4HO.mjs} +1 -1
- package/dist/chunk-6QJ2HF4O.mjs +11 -0
- package/dist/{chunk-6Q6A3BQH.mjs → chunk-BRDUM7MJ.mjs} +15 -15
- package/dist/{chunk-2LVYDXZS.mjs → chunk-CRF2GWQA.mjs} +3 -3
- package/dist/{chunk-TCVU3WEN.mjs → chunk-DB4R5IWG.mjs} +4 -4
- package/dist/{chunk-D2RG73WI.mjs → chunk-HCFEY5Y7.mjs} +475 -288
- package/dist/{chunk-VUEM62JF.mjs → chunk-UB2DES2O.mjs} +17 -6
- package/dist/{chunk-M2RKJTNY.mjs → chunk-WGPCLAZR.mjs} +1 -1
- package/dist/{chunk-HMTHZBH6.mjs → chunk-Z6IIVDFY.mjs} +1 -1
- package/dist/{full-7KJICNR5.mjs → full-24FOTNTB.mjs} +6 -6
- package/dist/full-7ABPY2WA.css +311 -0
- package/dist/{index-DVwiIwYU.d.mts → index-BOP2qNVA.d.mts} +1 -1
- package/dist/{index-ComBHfdn.d.ts → index-_G46lHpL.d.ts} +1 -1
- package/dist/index.css +1307 -1203
- package/dist/index.d.mts +11 -20
- package/dist/index.d.ts +11 -20
- package/dist/index.js +572 -372
- package/dist/index.mjs +10 -10
- package/dist/internal.d.mts +2 -2
- package/dist/internal.d.ts +2 -2
- package/dist/internal.js +17 -6
- package/dist/internal.mjs +1 -1
- package/dist/{loaded-DGSPK47E.mjs → loaded-6IBSSOXD.mjs} +3 -3
- package/dist/{loaded-IJNA4SY5.mjs → loaded-6NPDD7SF.mjs} +3 -3
- package/dist/{loaded-CBJRWD4Z.mjs → loaded-BQVZGQG2.mjs} +3 -3
- package/dist/loaded-N4KWL7FV.css +90 -0
- package/dist/no-external.css +1307 -1203
- package/dist/no-external.d.mts +4 -4
- package/dist/no-external.d.ts +4 -4
- package/dist/no-external.js +572 -372
- package/dist/no-external.mjs +10 -10
- package/dist/rsc.css +41 -41
- package/dist/rsc.d.mts +2 -2
- package/dist/rsc.d.ts +2 -2
- package/dist/rsc.js +5 -5
- package/dist/rsc.mjs +2 -2
- package/dist/{walk-tree-BPIigVTF.d.mts → walk-tree-Dwv3c_9M.d.mts} +1 -1
- package/dist/{walk-tree-BZq1CPCH.d.ts → walk-tree-DxSkPLnl.d.ts} +1 -1
- package/package.json +2 -1
- package/dist/Editor-GBV2O5RD.css +0 -415
- package/dist/Render-EFT7YD2C.css +0 -103
- package/dist/chunk-MFI3RDA4.mjs +0 -11
- package/dist/full-ELX6RALJ.css +0 -311
- package/dist/loaded-TBSVRJPY.css +0 -90
package/dist/index.mjs
CHANGED
|
@@ -19,14 +19,14 @@ import {
|
|
|
19
19
|
setDeep,
|
|
20
20
|
useEditor,
|
|
21
21
|
useGetEditor
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import "./chunk-
|
|
22
|
+
} from "./chunk-HCFEY5Y7.mjs";
|
|
23
|
+
import "./chunk-DB4R5IWG.mjs";
|
|
24
24
|
import {
|
|
25
25
|
migrate,
|
|
26
26
|
resolveAllData,
|
|
27
27
|
transformProps
|
|
28
|
-
} from "./chunk-
|
|
29
|
-
import "./chunk-
|
|
28
|
+
} from "./chunk-275EJPEB.mjs";
|
|
29
|
+
import "./chunk-6QJ2HF4O.mjs";
|
|
30
30
|
import {
|
|
31
31
|
Action,
|
|
32
32
|
ActionBar,
|
|
@@ -35,12 +35,12 @@ import {
|
|
|
35
35
|
Label,
|
|
36
36
|
RichTextMenu,
|
|
37
37
|
Separator
|
|
38
|
-
} from "./chunk-
|
|
39
|
-
import "./chunk-
|
|
40
|
-
import "./chunk-
|
|
41
|
-
import "./chunk-
|
|
42
|
-
import "./chunk-
|
|
43
|
-
import "./chunk-
|
|
38
|
+
} from "./chunk-BRDUM7MJ.mjs";
|
|
39
|
+
import "./chunk-Z6IIVDFY.mjs";
|
|
40
|
+
import "./chunk-6LG4Q4HO.mjs";
|
|
41
|
+
import "./chunk-WGPCLAZR.mjs";
|
|
42
|
+
import "./chunk-CRF2GWQA.mjs";
|
|
43
|
+
import "./chunk-UB2DES2O.mjs";
|
|
44
44
|
import "./chunk-VOLQMQPK.mjs";
|
|
45
45
|
import "./chunk-Y2EFNT5P.mjs";
|
|
46
46
|
import {
|
package/dist/internal.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Reducer } from 'react';
|
|
2
|
-
import { D as Data, A as AppState, O as OnAction, P as PrivateAppState, E as EditorAction } from './actions-
|
|
3
|
-
import { A as AppStore } from './index-
|
|
2
|
+
import { D as Data, A as AppState, O as OnAction, P as PrivateAppState, E as EditorAction } from './actions-CQmL3wwa.mjs';
|
|
3
|
+
import { A as AppStore } from './index-BOP2qNVA.mjs';
|
|
4
4
|
import '@tiptap/react';
|
|
5
5
|
import '@tiptap/extension-blockquote';
|
|
6
6
|
import '@tiptap/extension-bold';
|
package/dist/internal.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Reducer } from 'react';
|
|
2
|
-
import { D as Data, A as AppState, O as OnAction, P as PrivateAppState, E as EditorAction } from './actions-
|
|
3
|
-
import { A as AppStore } from './index-
|
|
2
|
+
import { D as Data, A as AppState, O as OnAction, P as PrivateAppState, E as EditorAction } from './actions-CQmL3wwa.js';
|
|
3
|
+
import { A as AppStore } from './index-_G46lHpL.js';
|
|
4
4
|
import '@tiptap/react';
|
|
5
5
|
import '@tiptap/extension-blockquote';
|
|
6
6
|
import '@tiptap/extension-bold';
|
package/dist/internal.js
CHANGED
|
@@ -491,20 +491,31 @@ var populateIds = (data, config, override = false) => {
|
|
|
491
491
|
|
|
492
492
|
// reducer/actions/insert.ts
|
|
493
493
|
function insertAction(state, action, appStore) {
|
|
494
|
+
var _a, _b;
|
|
494
495
|
const id = action.id || generateId(action.componentType);
|
|
496
|
+
const componentConfig = appStore.config.components[action.componentType];
|
|
497
|
+
const isGlobalType = (componentConfig == null ? void 0 : componentConfig.global) === true;
|
|
498
|
+
const defaultProps = (componentConfig == null ? void 0 : componentConfig.defaultProps) || {};
|
|
495
499
|
const emptyComponentData = populateIds(
|
|
496
|
-
{
|
|
500
|
+
__spreadValues({
|
|
497
501
|
type: action.componentType,
|
|
498
|
-
props: __spreadProps(__spreadValues({},
|
|
499
|
-
|
|
500
|
-
})
|
|
501
|
-
},
|
|
502
|
+
props: __spreadProps(__spreadValues({}, defaultProps), { id })
|
|
503
|
+
}, isGlobalType ? { synced: true } : {}),
|
|
502
504
|
appStore.config
|
|
503
505
|
);
|
|
504
506
|
const [parentId] = action.destinationZone.split(":");
|
|
505
507
|
const idsInPath = getIdsForParent(action.destinationZone, state);
|
|
508
|
+
let nextData = state.data;
|
|
509
|
+
if (isGlobalType && !((_a = nextData.globals) != null ? _a : {})[action.componentType]) {
|
|
510
|
+
nextData = __spreadProps(__spreadValues({}, nextData), {
|
|
511
|
+
globals: __spreadProps(__spreadValues({}, (_b = nextData.globals) != null ? _b : {}), {
|
|
512
|
+
[action.componentType]: { props: __spreadValues({}, defaultProps) }
|
|
513
|
+
})
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
const seededState = nextData === state.data ? state : __spreadProps(__spreadValues({}, state), { data: nextData });
|
|
506
517
|
return walkAppState(
|
|
507
|
-
|
|
518
|
+
seededState,
|
|
508
519
|
appStore.config,
|
|
509
520
|
(content, zoneCompound) => {
|
|
510
521
|
if (zoneCompound === action.destinationZone) {
|
package/dist/internal.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useListOptions
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WGPCLAZR.mjs";
|
|
4
4
|
import {
|
|
5
5
|
List,
|
|
6
6
|
SelectControl,
|
|
7
7
|
useControlContext
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-CRF2GWQA.mjs";
|
|
9
|
+
import "./chunk-UB2DES2O.mjs";
|
|
10
10
|
import "./chunk-VOLQMQPK.mjs";
|
|
11
11
|
import "./chunk-Y2EFNT5P.mjs";
|
|
12
12
|
import "./chunk-GAUBBDIR.mjs";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useHeadingOptions
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6LG4Q4HO.mjs";
|
|
4
4
|
import {
|
|
5
5
|
Heading,
|
|
6
6
|
SelectControl,
|
|
7
7
|
useControlContext
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-CRF2GWQA.mjs";
|
|
9
|
+
import "./chunk-UB2DES2O.mjs";
|
|
10
10
|
import "./chunk-VOLQMQPK.mjs";
|
|
11
11
|
import "./chunk-Y2EFNT5P.mjs";
|
|
12
12
|
import "./chunk-GAUBBDIR.mjs";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useAlignOptions
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Z6IIVDFY.mjs";
|
|
4
4
|
import {
|
|
5
5
|
AlignLeft,
|
|
6
6
|
SelectControl,
|
|
7
7
|
useControlContext
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-CRF2GWQA.mjs";
|
|
9
|
+
import "./chunk-UB2DES2O.mjs";
|
|
10
10
|
import "./chunk-VOLQMQPK.mjs";
|
|
11
11
|
import "./chunk-Y2EFNT5P.mjs";
|
|
12
12
|
import "./chunk-GAUBBDIR.mjs";
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/* css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Select/styles.module.css/#css-module-data */
|
|
2
|
+
._Select_1hzg4_1 {
|
|
3
|
+
position: relative;
|
|
4
|
+
z-index: 1;
|
|
5
|
+
}
|
|
6
|
+
._Select-button_1hzg4_6 {
|
|
7
|
+
align-items: center;
|
|
8
|
+
background: transparent;
|
|
9
|
+
border: none;
|
|
10
|
+
border-radius: var(--editor-radius-sm);
|
|
11
|
+
display: flex;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
gap: 0px;
|
|
14
|
+
height: 100%;
|
|
15
|
+
padding: 4px;
|
|
16
|
+
padding-right: 2px;
|
|
17
|
+
transition: background-color var(--editor-motion-fast) var(--editor-ease), color var(--editor-motion-fast) var(--editor-ease);
|
|
18
|
+
}
|
|
19
|
+
._Select--hasOptions_1hzg4_21 ._Select-button_1hzg4_6 {
|
|
20
|
+
color: currentColor;
|
|
21
|
+
}
|
|
22
|
+
._Select--hasOptions_1hzg4_21:not(._Select--disabled_1hzg4_25) ._Select-button_1hzg4_6 {
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
}
|
|
25
|
+
._Select-buttonIcon_1hzg4_29 {
|
|
26
|
+
align-items: center;
|
|
27
|
+
display: flex;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
}
|
|
30
|
+
._Select--standalone_1hzg4_35 ._Select-buttonIcon_1hzg4_29 .lucide {
|
|
31
|
+
height: 18px;
|
|
32
|
+
width: 18px;
|
|
33
|
+
}
|
|
34
|
+
._Select--actionBar_1hzg4_40 ._Select-buttonIcon_1hzg4_29 .lucide {
|
|
35
|
+
height: 16px;
|
|
36
|
+
width: 16px;
|
|
37
|
+
}
|
|
38
|
+
._Select--hasOptions_1hzg4_21:not(._Select--disabled_1hzg4_25) ._Select-button_1hzg4_6:hover,
|
|
39
|
+
._Select--hasValue_1hzg4_46 ._Select-button_1hzg4_6 {
|
|
40
|
+
background: var(--editor-surface-hover);
|
|
41
|
+
color: var(--editor-text-accent);
|
|
42
|
+
}
|
|
43
|
+
._Select--disabled_1hzg4_25 ._Select-button_1hzg4_6 {
|
|
44
|
+
color: var(--editor-text-tertiary);
|
|
45
|
+
}
|
|
46
|
+
._Select--actionBar_1hzg4_40 {
|
|
47
|
+
&._Select--hasOptions_1hzg4_21 ._Select-button_1hzg4_6:hover,
|
|
48
|
+
&._Select--hasValue_1hzg4_46 ._Select-button_1hzg4_6 {
|
|
49
|
+
background: rgba(255, 255, 255, 0.12);
|
|
50
|
+
color: var(--editor-text-inverse);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
._Select-items_1hzg4_63 {
|
|
54
|
+
background: var(--editor-surface-panel);
|
|
55
|
+
border: 1px solid var(--editor-border-subtle);
|
|
56
|
+
border-radius: var(--editor-radius-lg);
|
|
57
|
+
box-shadow: var(--editor-shadow-lg);
|
|
58
|
+
margin: 10px 8px;
|
|
59
|
+
margin-left: 0;
|
|
60
|
+
padding: 4px;
|
|
61
|
+
z-index: 2;
|
|
62
|
+
list-style: none;
|
|
63
|
+
}
|
|
64
|
+
._SelectItem_1hzg4_75 {
|
|
65
|
+
background: transparent;
|
|
66
|
+
border-radius: var(--editor-radius-sm);
|
|
67
|
+
border: none;
|
|
68
|
+
color: var(--editor-text-secondary);
|
|
69
|
+
cursor: pointer;
|
|
70
|
+
display: flex;
|
|
71
|
+
gap: 8px;
|
|
72
|
+
align-items: center;
|
|
73
|
+
font-size: var(--editor-font-size-xxs);
|
|
74
|
+
margin: 0;
|
|
75
|
+
padding: 8px 12px;
|
|
76
|
+
width: 100%;
|
|
77
|
+
transition: background-color var(--editor-motion-fast) var(--editor-ease), color var(--editor-motion-fast) var(--editor-ease);
|
|
78
|
+
}
|
|
79
|
+
._SelectItem--isSelected_1hzg4_92 {
|
|
80
|
+
background: var(--editor-accent-soft);
|
|
81
|
+
color: var(--editor-text-accent);
|
|
82
|
+
font-weight: 500;
|
|
83
|
+
}
|
|
84
|
+
._SelectItem--isSelected_1hzg4_92 ._SelectItem-icon_1hzg4_98 {
|
|
85
|
+
color: var(--editor-text-accent);
|
|
86
|
+
}
|
|
87
|
+
._SelectItem_1hzg4_75:hover {
|
|
88
|
+
background: var(--editor-surface-hover);
|
|
89
|
+
color: var(--editor-text-accent);
|
|
90
|
+
}
|