@gem-sdk/core 1.22.31-new-feature.13 → 1.22.31-new-feature.15

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.
@@ -128,6 +128,18 @@ const ComponentToolbarPreview = ({ ...props })=>{
128
128
  window.dispatchEvent(event);
129
129
  return false;
130
130
  };
131
+ const onZoomOut = (e)=>{
132
+ e.preventDefault();
133
+ e.stopPropagation();
134
+ const event = new CustomEvent('editor:toolbar:zoom-out-component', {
135
+ bubbles: true,
136
+ detail: {
137
+ componentUid: props.uid
138
+ }
139
+ });
140
+ window.dispatchEvent(event);
141
+ return false;
142
+ };
131
143
  const closeAddSection = ()=>{
132
144
  setActiveAddSection(null);
133
145
  window.removeEventListener('editor:close-add-section-popup', closeAddSection);
@@ -205,10 +217,10 @@ const ComponentToolbarPreview = ({ ...props })=>{
205
217
  }),
206
218
  props.tag == 'Section' ? /*#__PURE__*/ jsxRuntime.jsx("div", {
207
219
  "data-toolbar-name": true,
208
- children: isThemeSection ? props.name : `Section ${getIndexSection() + 1}`
220
+ children: isThemeSection ? props.customLabel || props.label : `Section ${getIndexSection() + 1}${getSectionNumber() >= SECTION_LIMIT - 5 ? `/${SECTION_LIMIT}` : ''}`
209
221
  }) : /*#__PURE__*/ jsxRuntime.jsx("div", {
210
222
  "data-toolbar-name": true,
211
- children: props.label
223
+ children: props.customLabel || props.label
212
224
  }),
213
225
  props.tag !== 'Section' && parents.length > 0 && /*#__PURE__*/ jsxRuntime.jsx("div", {
214
226
  "data-toolbar-icon-parent": true,
@@ -278,6 +290,24 @@ const ComponentToolbarPreview = ({ ...props })=>{
278
290
  editingPageType !== 'STATIC' && getSectionNumber() <= SECTION_LIMIT && /*#__PURE__*/ jsxRuntime.jsx(CreateThemeSection.CreateThemeSection, {
279
291
  ...props
280
292
  }),
293
+ props.tag == 'Sticky' && /*#__PURE__*/ jsxRuntime.jsx("div", {
294
+ "data-toolbar-zoom-out": true,
295
+ onClick: (e)=>onZoomOut(e),
296
+ "aria-hidden": "true",
297
+ children: /*#__PURE__*/ jsxRuntime.jsx("svg", {
298
+ width: "16",
299
+ height: "16",
300
+ viewBox: "0 0 16 16",
301
+ fill: "none",
302
+ xmlns: "http://www.w3.org/2000/svg",
303
+ children: /*#__PURE__*/ jsxRuntime.jsx("path", {
304
+ fillRule: "evenodd",
305
+ clipRule: "evenodd",
306
+ d: "M14.5 7C14.7761 7 15 6.77614 15 6.5C15 6.22386 14.7761 6 14.5 6L10.7072 6L14.8536 1.85355C15.0489 1.65829 15.0489 1.34171 14.8536 1.14645C14.6584 0.951186 14.3418 0.951185 14.1465 1.14645L10 5.29297L10 1.5C10 1.22386 9.77614 1 9.5 1C9.22386 1 9 1.22386 9 1.5L9 6.5C9 6.77614 9.22386 7 9.5 7L14.5 7ZM6 10.7073L6 14.5C6 14.7761 6.22386 15 6.5 15C6.77614 15 7 14.7761 7 14.5L7 9.5C7 9.22386 6.77614 9 6.5 9H1.5C1.22386 9 1 9.22386 1 9.5C1 9.77614 1.22386 10 1.5 10H5.29306L1.14662 14.1464C0.951353 14.3417 0.951353 14.6583 1.14662 14.8536C1.34188 15.0488 1.65846 15.0488 1.85372 14.8536L6 10.7073Z",
307
+ fill: "currentColor"
308
+ })
309
+ })
310
+ }),
281
311
  /*#__PURE__*/ jsxRuntime.jsx(Tooltip.default, {
282
312
  enable: props.tag == 'Section' && getSectionNumber() >= SECTION_LIMIT,
283
313
  text: "Page has reached Shopify’s 25 section-limit",
@@ -126,6 +126,18 @@ const ComponentToolbarPreview = ({ ...props })=>{
126
126
  window.dispatchEvent(event);
127
127
  return false;
128
128
  };
129
+ const onZoomOut = (e)=>{
130
+ e.preventDefault();
131
+ e.stopPropagation();
132
+ const event = new CustomEvent('editor:toolbar:zoom-out-component', {
133
+ bubbles: true,
134
+ detail: {
135
+ componentUid: props.uid
136
+ }
137
+ });
138
+ window.dispatchEvent(event);
139
+ return false;
140
+ };
129
141
  const closeAddSection = ()=>{
130
142
  setActiveAddSection(null);
131
143
  window.removeEventListener('editor:close-add-section-popup', closeAddSection);
@@ -203,10 +215,10 @@ const ComponentToolbarPreview = ({ ...props })=>{
203
215
  }),
204
216
  props.tag == 'Section' ? /*#__PURE__*/ jsx("div", {
205
217
  "data-toolbar-name": true,
206
- children: isThemeSection ? props.name : `Section ${getIndexSection() + 1}`
218
+ children: isThemeSection ? props.customLabel || props.label : `Section ${getIndexSection() + 1}${getSectionNumber() >= SECTION_LIMIT - 5 ? `/${SECTION_LIMIT}` : ''}`
207
219
  }) : /*#__PURE__*/ jsx("div", {
208
220
  "data-toolbar-name": true,
209
- children: props.label
221
+ children: props.customLabel || props.label
210
222
  }),
211
223
  props.tag !== 'Section' && parents.length > 0 && /*#__PURE__*/ jsx("div", {
212
224
  "data-toolbar-icon-parent": true,
@@ -276,6 +288,24 @@ const ComponentToolbarPreview = ({ ...props })=>{
276
288
  editingPageType !== 'STATIC' && getSectionNumber() <= SECTION_LIMIT && /*#__PURE__*/ jsx(CreateThemeSection, {
277
289
  ...props
278
290
  }),
291
+ props.tag == 'Sticky' && /*#__PURE__*/ jsx("div", {
292
+ "data-toolbar-zoom-out": true,
293
+ onClick: (e)=>onZoomOut(e),
294
+ "aria-hidden": "true",
295
+ children: /*#__PURE__*/ jsx("svg", {
296
+ width: "16",
297
+ height: "16",
298
+ viewBox: "0 0 16 16",
299
+ fill: "none",
300
+ xmlns: "http://www.w3.org/2000/svg",
301
+ children: /*#__PURE__*/ jsx("path", {
302
+ fillRule: "evenodd",
303
+ clipRule: "evenodd",
304
+ d: "M14.5 7C14.7761 7 15 6.77614 15 6.5C15 6.22386 14.7761 6 14.5 6L10.7072 6L14.8536 1.85355C15.0489 1.65829 15.0489 1.34171 14.8536 1.14645C14.6584 0.951186 14.3418 0.951185 14.1465 1.14645L10 5.29297L10 1.5C10 1.22386 9.77614 1 9.5 1C9.22386 1 9 1.22386 9 1.5L9 6.5C9 6.77614 9.22386 7 9.5 7L14.5 7ZM6 10.7073L6 14.5C6 14.7761 6.22386 15 6.5 15C6.77614 15 7 14.7761 7 14.5L7 9.5C7 9.22386 6.77614 9 6.5 9H1.5C1.22386 9 1 9.22386 1 9.5C1 9.77614 1.22386 10 1.5 10H5.29306L1.14662 14.1464C0.951353 14.3417 0.951353 14.6583 1.14662 14.8536C1.34188 15.0488 1.65846 15.0488 1.85372 14.8536L6 10.7073Z",
305
+ fill: "currentColor"
306
+ })
307
+ })
308
+ }),
279
309
  /*#__PURE__*/ jsx(Tooltip, {
280
310
  enable: props.tag == 'Section' && getSectionNumber() >= SECTION_LIMIT,
281
311
  text: "Page has reached Shopify’s 25 section-limit",
@@ -30,6 +30,8 @@ type BlockEntity = {
30
30
  uid: string;
31
31
  tag: string;
32
32
  label?: string;
33
+ customLabel?: string;
34
+ name?: string;
33
35
  dateModified?: string | number;
34
36
  childrens?: string[];
35
37
  settings?: Record<string, any>;
@@ -37,7 +39,6 @@ type BlockEntity = {
37
39
  styles?: Record<string, any>;
38
40
  editorConfigs?: Record<string, any>;
39
41
  type?: 'component';
40
- name?: string;
41
42
  isThemeSection?: boolean;
42
43
  needPublishing?: boolean;
43
44
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "1.22.31-new-feature.13",
3
+ "version": "1.22.31-new-feature.15",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "devDependencies": {
27
27
  "@gem-sdk/adapter-shopify": "1.22.31-staging.0",
28
- "@gem-sdk/styles": "1.22.31-new-feature.13"
28
+ "@gem-sdk/styles": "1.22.31-new-feature.15"
29
29
  },
30
30
  "dependencies": {
31
31
  "react-error-boundary": "4.0.10",