@gem-sdk/core 12.0.0-staging.79 → 12.0.0-staging.83
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/cjs/graphql/fragments/product-variants-with-selling-plans-select.generated.js +1 -0
- package/dist/cjs/helpers/createTranslateKey.js +1 -1
- package/dist/esm/graphql/fragments/product-variants-with-selling-plans-select.generated.js +1 -0
- package/dist/esm/helpers/createTranslateKey.js +1 -1
- package/dist/types/index.d.ts +7 -7
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var index=require("../constants/index.js"),getHashCode=require("./getHashCode.js");const getThemeSectionTranslateKey=({uid:e,settingId:t,schema:r,value:
|
|
1
|
+
"use strict";var index=require("../constants/index.js"),getHashCode=require("./getHashCode.js");const getThemeSectionTranslateKey=({uid:e,settingId:t,schema:r,value:n})=>{let a=`g${e}_${t}`,{translateKey:s,value:i}=getValueSettingFromSchema({input:r??"",prefixTranslateKey:a}),l=extractOuterTagContent(i),o=extractOuterTagContent(n),g=checkHasChangeContent({currentContent:l,newContent:o});return g?createTranslateKey(e,t,o):s},createTranslateKey=(e,t,r)=>{let n=getHashCode.getHashCode(r??"");return`g${e}_${t}_${n}`};function getValueSettingFromSchema({input:e,prefixTranslateKey:t}){let r;if("string"==typeof e)try{r=e.trim()?JSON.parse(e):{}}catch{r={}}else r=e;let n=Array.isArray(r?.settings)?r.settings:[],a=n.find(e=>e?.id?.includes(t));return{value:a?.default,translateKey:a?.id??""}}function extractOuterTagContent(e,t=10){if(!e||"string"!=typeof e)return"";let r=e.trim();for(let e=0;e<t;e++){let e=parseOuterWrapper(r);if(!e)break;let t=e.tag.toLowerCase();if(index.BLACKLIST_TAGS.has(t))break;r=e.inner.trim()}return r}function replaceOuterTagContent(e,t=10,r=""){if(!e||"string"!=typeof e)return"";let n=e.trim(),a=[];for(let e=0;e<t;e++){let e=parseOuterWrapper(n);if(!e)break;let t=e.tag?.toLowerCase()||"";if(a.push({tag:e.tag,attrs:e.attrs}),index.BLACKLIST_TAGS.has(t))break;n=e.inner.trim()}let s=r;for(let e=a.length-1;e>=0;e--){let t=a[e];if(!t)continue;let{tag:r,attrs:n}=t;s=`<${r}${n}>${s}</${r}>`}return s}function parseOuterWrapper(e){let t;let r=e.match(/^<([a-z][\w:-]*)\b([^>]*)>/i);if(!r?.[1])return null;let n=r[0];if(n.endsWith("/>"))return null;let a=r[1],s=r[2]??"",i=n.length,l=RegExp(`<\\/?${a}\\b[^>]*>`,"gi");l.lastIndex=i;let o=1,g=-1,u=-1;for(;t=l.exec(e);){let e=t[0],r=e.startsWith("</"),n=e.endsWith("/>");if(!r&&!n){o+=1;continue}if(r&&0==(o-=1)){g=t.index,u=l.lastIndex;break}}return -1===g||u!==e.length?null:{tag:a,attrs:s,inner:e.slice(i,g)}}function checkHasChangeContent({currentContent:e,newContent:t}){let r=getHashCode.getHashCode(e),n=getHashCode.getHashCode(t);return r!==n}exports.checkHasChangeContent=checkHasChangeContent,exports.createTranslateKey=createTranslateKey,exports.extractOuterTagContent=extractOuterTagContent,exports.getThemeSectionTranslateKey=getThemeSectionTranslateKey,exports.getValueSettingFromSchema=getValueSettingFromSchema,exports.replaceOuterTagContent=replaceOuterTagContent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{BLACKLIST_TAGS as e}from"../constants/index.js";import{getHashCode as t}from"./getHashCode.js";let getThemeSectionTranslateKey=({uid:e,settingId:t,schema:r,value:n})=>{let a=`g${e}_${t}`,{translateKey:i,value:l}=getValueSettingFromSchema({input:r??"",prefixTranslateKey:a}),
|
|
1
|
+
import{BLACKLIST_TAGS as e}from"../constants/index.js";import{getHashCode as t}from"./getHashCode.js";let getThemeSectionTranslateKey=({uid:e,settingId:t,schema:r,value:n})=>{let a=`g${e}_${t}`,{translateKey:i,value:l}=getValueSettingFromSchema({input:r??"",prefixTranslateKey:a}),s=extractOuterTagContent(l),o=extractOuterTagContent(n),u=checkHasChangeContent({currentContent:s,newContent:o});return u?createTranslateKey(e,t,o):i},createTranslateKey=(e,r,n)=>{let a=t(n??"");return`g${e}_${r}_${a}`};function getValueSettingFromSchema({input:e,prefixTranslateKey:t}){let r;if("string"==typeof e)try{r=e.trim()?JSON.parse(e):{}}catch{r={}}else r=e;let n=Array.isArray(r?.settings)?r.settings:[],a=n.find(e=>e?.id?.includes(t));return{value:a?.default,translateKey:a?.id??""}}function extractOuterTagContent(t,r=10){if(!t||"string"!=typeof t)return"";let n=t.trim();for(let t=0;t<r;t++){let t=parseOuterWrapper(n);if(!t)break;let r=t.tag.toLowerCase();if(e.has(r))break;n=t.inner.trim()}return n}function replaceOuterTagContent(t,r=10,n=""){if(!t||"string"!=typeof t)return"";let a=t.trim(),i=[];for(let t=0;t<r;t++){let t=parseOuterWrapper(a);if(!t)break;let r=t.tag?.toLowerCase()||"";if(i.push({tag:t.tag,attrs:t.attrs}),e.has(r))break;a=t.inner.trim()}let l=n;for(let e=i.length-1;e>=0;e--){let t=i[e];if(!t)continue;let{tag:r,attrs:n}=t;l=`<${r}${n}>${l}</${r}>`}return l}function parseOuterWrapper(e){let t;let r=e.match(/^<([a-z][\w:-]*)\b([^>]*)>/i);if(!r?.[1])return null;let n=r[0];if(n.endsWith("/>"))return null;let a=r[1],i=r[2]??"",l=n.length,s=RegExp(`<\\/?${a}\\b[^>]*>`,"gi");s.lastIndex=l;let o=1,u=-1,c=-1;for(;t=s.exec(e);){let e=t[0],r=e.startsWith("</"),n=e.endsWith("/>");if(!r&&!n){o+=1;continue}if(r&&0==(o-=1)){u=t.index,c=s.lastIndex;break}}return -1===u||c!==e.length?null:{tag:a,attrs:i,inner:e.slice(l,u)}}function checkHasChangeContent({currentContent:e,newContent:r}){let n=t(e),a=t(r);return n!==a}export{checkHasChangeContent,createTranslateKey,extractOuterTagContent,getThemeSectionTranslateKey,getValueSettingFromSchema,replaceOuterTagContent};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -44971,7 +44971,7 @@ type ProductVariantsWithSellingPlansSelectFragment = Pick<ProductVariant$1, 'id'
|
|
|
44971
44971
|
selectedOptions: Array<Pick<SelectedOption$1, 'name' | 'value' | 'optionType'>>;
|
|
44972
44972
|
media?: Maybe$1<Pick<Media$1, 'id' | 'baseID' | 'contentType' | 'previewImage' | 'src' | 'width' | 'height' | 'alt'>>;
|
|
44973
44973
|
sellingPlanGroups?: Maybe$1<Array<Maybe$1<Pick<SellingPlanGroup$1, 'id' | 'appID'> & {
|
|
44974
|
-
sellingPlans?: Maybe$1<Array<Maybe$1<Pick<SellingPlan$1, 'id' | 'name' | 'baseID' | 'billingPolicy' | 'pricingPolicies' | 'updatedAt'>>>>;
|
|
44974
|
+
sellingPlans?: Maybe$1<Array<Maybe$1<Pick<SellingPlan$1, 'id' | 'name' | 'baseID' | 'billingPolicy' | 'deliveryPolicy' | 'pricingPolicies' | 'updatedAt'>>>>;
|
|
44975
44975
|
}>>>;
|
|
44976
44976
|
};
|
|
44977
44977
|
|
|
@@ -44986,7 +44986,7 @@ type ProductsWithSellingPlansDetailFragment = Pick<Product$1, 'id' | 'title' | '
|
|
|
44986
44986
|
}>;
|
|
44987
44987
|
}>;
|
|
44988
44988
|
sellingPlanGroups?: Maybe$1<Array<Maybe$1<Pick<SellingPlanGroup$1, 'appID' | 'baseID' | 'id' | 'name'> & {
|
|
44989
|
-
sellingPlans?: Maybe$1<Array<Maybe$1<Pick<SellingPlan$1, 'id' | 'name' | 'baseID' | 'billingPolicy' | 'pricingPolicies' | 'updatedAt'>>>>;
|
|
44989
|
+
sellingPlans?: Maybe$1<Array<Maybe$1<Pick<SellingPlan$1, 'id' | 'name' | 'baseID' | 'billingPolicy' | 'deliveryPolicy' | 'pricingPolicies' | 'updatedAt'>>>>;
|
|
44990
44990
|
}>>>;
|
|
44991
44991
|
medias?: Maybe$1<{
|
|
44992
44992
|
edges: Array<Pick<MediaEdge$1, 'cursor'> & {
|
|
@@ -45000,7 +45000,7 @@ type ProductsWithSellingPlansDetailFragment = Pick<Product$1, 'id' | 'title' | '
|
|
|
45000
45000
|
selectedOptions: Array<Pick<SelectedOption$1, 'name' | 'value' | 'optionType'>>;
|
|
45001
45001
|
media?: Maybe$1<Pick<Media$1, 'id' | 'baseID' | 'contentType' | 'previewImage' | 'src' | 'width' | 'height' | 'alt'>>;
|
|
45002
45002
|
sellingPlanGroups?: Maybe$1<Array<Maybe$1<Pick<SellingPlanGroup$1, 'id' | 'appID'> & {
|
|
45003
|
-
sellingPlans?: Maybe$1<Array<Maybe$1<Pick<SellingPlan$1, 'id' | 'name' | 'baseID' | 'billingPolicy' | 'pricingPolicies' | 'updatedAt'>>>>;
|
|
45003
|
+
sellingPlans?: Maybe$1<Array<Maybe$1<Pick<SellingPlan$1, 'id' | 'name' | 'baseID' | 'billingPolicy' | 'deliveryPolicy' | 'pricingPolicies' | 'updatedAt'>>>>;
|
|
45004
45004
|
}>>>;
|
|
45005
45005
|
}>;
|
|
45006
45006
|
}>;
|
|
@@ -45590,7 +45590,7 @@ type ProductsWithSellingPlansQueryResponse = {
|
|
|
45590
45590
|
selectedOptions: Array<Pick<SelectedOption$1, 'name' | 'value' | 'optionType'>>;
|
|
45591
45591
|
media?: Maybe$1<Pick<Media$1, 'id' | 'baseID' | 'contentType' | 'previewImage' | 'src' | 'width' | 'height' | 'alt'>>;
|
|
45592
45592
|
sellingPlanGroups?: Maybe$1<Array<Maybe$1<Pick<SellingPlanGroup$1, 'id' | 'appID'> & {
|
|
45593
|
-
sellingPlans?: Maybe$1<Array<Maybe$1<Pick<SellingPlan$1, 'id' | 'name' | 'baseID' | 'billingPolicy' | 'pricingPolicies' | 'updatedAt'>>>>;
|
|
45593
|
+
sellingPlans?: Maybe$1<Array<Maybe$1<Pick<SellingPlan$1, 'id' | 'name' | 'baseID' | 'billingPolicy' | 'deliveryPolicy' | 'pricingPolicies' | 'updatedAt'>>>>;
|
|
45594
45594
|
}>>>;
|
|
45595
45595
|
}>;
|
|
45596
45596
|
}>;
|
|
@@ -45622,7 +45622,7 @@ type ProductVariantsWithSellingPlansQueryResponse = {
|
|
|
45622
45622
|
selectedOptions: Array<Pick<SelectedOption$1, 'name' | 'value' | 'optionType'>>;
|
|
45623
45623
|
media?: Maybe$1<Pick<Media$1, 'id' | 'baseID' | 'contentType' | 'previewImage' | 'src' | 'width' | 'height' | 'alt'>>;
|
|
45624
45624
|
sellingPlanGroups?: Maybe$1<Array<Maybe$1<Pick<SellingPlanGroup$1, 'id' | 'appID'> & {
|
|
45625
|
-
sellingPlans?: Maybe$1<Array<Maybe$1<Pick<SellingPlan$1, 'id' | 'name' | 'baseID' | 'billingPolicy' | 'pricingPolicies' | 'updatedAt'>>>>;
|
|
45625
|
+
sellingPlans?: Maybe$1<Array<Maybe$1<Pick<SellingPlan$1, 'id' | 'name' | 'baseID' | 'billingPolicy' | 'deliveryPolicy' | 'pricingPolicies' | 'updatedAt'>>>>;
|
|
45626
45626
|
}>>>;
|
|
45627
45627
|
}>;
|
|
45628
45628
|
}>;
|
|
@@ -58532,14 +58532,14 @@ declare const useVariants: () => Maybe$1<Pick<ProductVariant$1, "id" | "title" |
|
|
|
58532
58532
|
selectedOptions: Pick<SelectedOption$1, "name" | "value" | "optionType">[];
|
|
58533
58533
|
media?: Maybe$1<Pick<Media$1, "id" | "width" | "height" | "baseID" | "contentType" | "previewImage" | "src" | "alt">>;
|
|
58534
58534
|
sellingPlanGroups?: Maybe$1<Maybe$1<Pick<SellingPlanGroup$1, "id" | "appID"> & {
|
|
58535
|
-
sellingPlans?: Maybe$1<Maybe$1<Pick<SellingPlan$1, "name" | "id" | "updatedAt" | "baseID" | "billingPolicy" | "pricingPolicies">>[]>;
|
|
58535
|
+
sellingPlans?: Maybe$1<Maybe$1<Pick<SellingPlan$1, "name" | "id" | "updatedAt" | "baseID" | "billingPolicy" | "deliveryPolicy" | "pricingPolicies">>[]>;
|
|
58536
58536
|
}>[]>;
|
|
58537
58537
|
}>[];
|
|
58538
58538
|
declare const useVariant: (id: string) => Maybe$1<Pick<ProductVariant$1, "id" | "title" | "price" | "width" | "length" | "weight" | "height" | "barcode" | "baseID" | "costPrice" | "inventoryPolicy" | "inventoryQuantity" | "inventoryStatus" | "isDigital" | "lowInventoryAmount" | "manageInventory" | "mediaId" | "platform" | "salePrice" | "sku" | "soldIndividually"> & {
|
|
58539
58539
|
selectedOptions: Pick<SelectedOption$1, "name" | "value" | "optionType">[];
|
|
58540
58540
|
media?: Maybe$1<Pick<Media$1, "id" | "width" | "height" | "baseID" | "contentType" | "previewImage" | "src" | "alt">>;
|
|
58541
58541
|
sellingPlanGroups?: Maybe$1<Maybe$1<Pick<SellingPlanGroup$1, "id" | "appID"> & {
|
|
58542
|
-
sellingPlans?: Maybe$1<Maybe$1<Pick<SellingPlan$1, "name" | "id" | "updatedAt" | "baseID" | "billingPolicy" | "pricingPolicies">>[]>;
|
|
58542
|
+
sellingPlans?: Maybe$1<Maybe$1<Pick<SellingPlan$1, "name" | "id" | "updatedAt" | "baseID" | "billingPolicy" | "deliveryPolicy" | "pricingPolicies">>[]>;
|
|
58543
58543
|
}>[]>;
|
|
58544
58544
|
}>;
|
|
58545
58545
|
declare const useCurrentVariant: () => Maybe$1<VariantSelectFragment>;
|