@reacteditor/core 0.0.15 → 0.0.17

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.
@@ -25,8 +25,8 @@ import {
25
25
  usePropsContext,
26
26
  useRouteParams,
27
27
  useStableValue
28
- } from "./chunk-RAMNEU3M.mjs";
29
- import "./chunk-647NZJYM.mjs";
28
+ } from "./chunk-AXB6UJ2P.mjs";
29
+ import "./chunk-2A2HBRLV.mjs";
30
30
  import {
31
31
  Action,
32
32
  ActionBar,
@@ -35,22 +35,22 @@ import {
35
35
  Label,
36
36
  RichTextMenu,
37
37
  Separator
38
- } from "./chunk-TFAZFGYZ.mjs";
39
- import "./chunk-C2KWANIN.mjs";
38
+ } from "./chunk-OAOKQORI.mjs";
39
+ import "./chunk-CUGSM3PC.mjs";
40
40
  import {
41
41
  getRouteProps,
42
42
  migrate,
43
43
  resolveAllData,
44
44
  resolveRouteFromString,
45
45
  transformProps
46
- } from "./chunk-3CGBQNX4.mjs";
46
+ } from "./chunk-AD67LVXW.mjs";
47
47
  import "./chunk-6QJ2HF4O.mjs";
48
- import "./chunk-NKHR722W.mjs";
49
- import "./chunk-GIGXMGTZ.mjs";
50
- import "./chunk-T43H325W.mjs";
48
+ import "./chunk-ESU6AYGB.mjs";
49
+ import "./chunk-C5G7WUBQ.mjs";
50
+ import "./chunk-NUBRSWFJ.mjs";
51
51
  import "./chunk-M4JDRFYB.mjs";
52
- import "./chunk-NPC7A3V3.mjs";
53
- import "./chunk-Y2EFNT5P.mjs";
52
+ import "./chunk-FTVOCMGV.mjs";
53
+ import "./chunk-DQU3HIP4.mjs";
54
54
  import {
55
55
  walkTree
56
56
  } from "./chunk-JIXMPJZA.mjs";
package/dist/rsc.js CHANGED
@@ -160,19 +160,29 @@ var init_get_class_name_factory = __esm({
160
160
  "use strict";
161
161
  init_react_import();
162
162
  import_classnames = __toESM(require_classnames());
163
- getClassNameFactory = (rootClass, styles, config = { baseClass: "" }) => (options = {}) => {
163
+ getClassNameFactory = (rootClass, styles, config = { baseClass: "" }) => (options = {}, modifiers) => {
164
164
  if (typeof options === "string") {
165
165
  const descendant = options;
166
- const style = styles[`${rootClass}-${descendant}`];
166
+ const baseKey = `${rootClass}-${descendant}`;
167
+ const style = styles[baseKey];
168
+ if (modifiers) {
169
+ const prefixedModifiers = {};
170
+ for (let modifier in modifiers) {
171
+ prefixedModifiers[styles[`${baseKey}--${modifier}`]] = modifiers[modifier];
172
+ }
173
+ return config.baseClass + (0, import_classnames.default)(__spreadValues({
174
+ [style]: !!style
175
+ }, prefixedModifiers));
176
+ }
167
177
  if (style) {
168
- return config.baseClass + styles[`${rootClass}-${descendant}`] || "";
178
+ return config.baseClass + style;
169
179
  }
170
180
  return "";
171
181
  } else if (typeof options === "object") {
172
- const modifiers = options;
182
+ const modifiers2 = options;
173
183
  const prefixedModifiers = {};
174
- for (let modifier in modifiers) {
175
- prefixedModifiers[styles[`${rootClass}--${modifier}`]] = modifiers[modifier];
184
+ for (let modifier in modifiers2) {
185
+ prefixedModifiers[styles[`${rootClass}--${modifier}`]] = modifiers2[modifier];
176
186
  }
177
187
  const c = styles[rootClass];
178
188
  return config.baseClass + (0, import_classnames.default)(__spreadValues({
@@ -1145,6 +1155,16 @@ init_react_import();
1145
1155
 
1146
1156
  // store/default-app-state.ts
1147
1157
  init_react_import();
1158
+
1159
+ // components/ViewportControls/default-viewports.ts
1160
+ init_react_import();
1161
+ var defaultViewports = [
1162
+ { width: 360, height: "auto", icon: "Smartphone", label: "Small" },
1163
+ { width: 768, height: "auto", icon: "Tablet", label: "Medium" },
1164
+ { width: "100%", height: "auto", icon: "Monitor", label: "Desktop" }
1165
+ ];
1166
+
1167
+ // store/default-app-state.ts
1148
1168
  var defaultAppState = {
1149
1169
  data: { content: [], root: {}, zones: {} },
1150
1170
  ui: {
@@ -1157,9 +1177,10 @@ var defaultAppState = {
1157
1177
  isDragging: false,
1158
1178
  previewMode: "edit",
1159
1179
  viewports: {
1160
- // Default to the tablet viewport (the middle option) so the canvas
1161
- // opens at a comfortable preview width on most screens.
1162
- current: { width: 768, height: "auto" },
1180
+ current: {
1181
+ width: defaultViewports[0].width,
1182
+ height: defaultViewports[0].height || "auto"
1183
+ },
1163
1184
  options: [],
1164
1185
  controlsVisible: true
1165
1186
  },
package/dist/rsc.mjs CHANGED
@@ -7,10 +7,10 @@ import {
7
7
  transformProps,
8
8
  useRichtextProps,
9
9
  useSlots
10
- } from "./chunk-3CGBQNX4.mjs";
10
+ } from "./chunk-AD67LVXW.mjs";
11
11
  import "./chunk-6QJ2HF4O.mjs";
12
- import "./chunk-NPC7A3V3.mjs";
13
- import "./chunk-Y2EFNT5P.mjs";
12
+ import "./chunk-FTVOCMGV.mjs";
13
+ import "./chunk-DQU3HIP4.mjs";
14
14
  import {
15
15
  rootAreaId,
16
16
  rootDroppableId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reacteditor/core",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "description": "The open-source visual editor for React",
5
5
  "author": "Rami Bitar <rami@frontend.co>",
6
6
  "repository": "reacteditor/editor",
@@ -145,7 +145,6 @@
145
145
  "happy-dom": "^20.0.10",
146
146
  "object-hash": "^3.0.0",
147
147
  "react-hotkeys-hook": "^4.6.1",
148
- "react-zoom-pan-pinch": "^4.0.3",
149
148
  "use-debounce": "^9.0.4",
150
149
  "uuid": "^9.0.1",
151
150
  "zustand": "^5.0.3"