@sanity/core-loader
Advanced tools
Comparing version 1.3.2 to 1.3.3
@@ -34,2 +34,16 @@ # Changelog | ||
## [1.3.3](https://github.com/sanity-io/visual-editing/compare/core-loader-v1.3.2...core-loader-v1.3.3) (2024-01-04) | ||
### Bug Fixes | ||
* unsubscribe live queries that are no longer in use on the curren… ([#613](https://github.com/sanity-io/visual-editing/issues/613)) ([12bce7a](https://github.com/sanity-io/visual-editing/commit/12bce7ab6b26233db39626fd28d1dfd5b059e9c9)) | ||
### Dependencies | ||
* The following workspace dependencies were updated | ||
* devDependencies | ||
* @sanity/visual-editing-helpers bumped from 0.2.0 to 0.2.1 | ||
## [1.3.0](https://github.com/sanity-io/visual-editing/compare/core-loader-v1.2.0...core-loader-v1.3.0) (2023-12-12) | ||
@@ -36,0 +50,0 @@ |
@@ -1,1 +0,1 @@ | ||
import{getPublishedId as t,studioPath as e,studioPathToJsonPath as r,resolveEditInfo as i,jsonPathToStudioPath as n}from"@sanity/client/csm";function s(t){return"function"==typeof t?t():t}function o(t,e){return Array.isArray(t)?[void 0,t]:[t,e]}function a(t,e,r){return{typed:t,output:e,issues:r}}function p(t,e){return{reason:t?.reason,validation:e.validation,origin:t?.origin||"value",message:e.message,input:e.input,requirement:e?.requirement,path:e.path,abortEarly:t?.abortEarly,abortPipeEarly:t?.abortPipeEarly,skipPipe:t?.skipPipe}}function u(t,e){return{reason:e,origin:t?.origin,abortEarly:t?.abortEarly,abortPipeEarly:t?.abortPipeEarly,skipPipe:t?.skipPipe}}function f(t,e,r,i,n){let s,o=t;if(e?.length&&!r?.skipPipe)for(const t of e){const e=t._parse(o);if(e.issues){s=s||u(r,i);for(const t of e.issues){const e=p(s,t);n?n.push(e):n=[e]}if(s.abortEarly||s.abortPipeEarly)break}else o=e.output}return a(!0,o,n)}function c(t,e,r,i,n,o){return{typed:!1,output:n,issues:[{reason:e,validation:r,origin:t?.origin||"value",message:s(i),input:n,issues:o,abortEarly:t?.abortEarly,abortPipeEarly:t?.abortPipeEarly,skipPipe:t?.skipPipe}]}}function y(t){return null!==t&&Array.isArray(t)}function l(t){let e="";for(const r of t)"string"!=typeof r?"number"!=typeof r?y(r)?(e&&(e+=":"),e+=`${r.join(",")}}`):r._key&&(e&&(e+=":"),e+=`${r._key}`):(e&&(e+=":"),e+=`${r}`):(e&&(e+="."),e+=r);return e}const h=function(t,e){const[r="Invalid type",i]=o(t,e);return{type:"string",async:!1,message:r,pipe:i,_parse(t,e){return"string"!=typeof t?c(e,"type","string",this.message,t):f(t,this.pipe,e,"string")}}}([function(t,e="Invalid length"){return{type:"min_length",async:!1,message:e,requirement:t,_parse(t){return t.length<this.requirement?function(t,e,r,i,n){return{issues:[{validation:t,message:s(e),input:r,requirement:i,path:n}]}}(this.type,this.message,t,this.requirement):{output:t}}}}(1)]),b={type:"optional",async:!1,wrapped:h,default:d,_parse(t,e){if(void 0===t){const e="function"==typeof(r=this).default?r.default():r.default;if(void 0===e)return a(!0,t);t=e}var r;return this.wrapped._parse(t,e)}},g=function(t,e,r,i){const[n,s="Invalid type",p]=function(t,e,r){if(!t||"object"==typeof t&&!Array.isArray(t)){const[i,n]=o(e,r);return[t,i,n]}const[i,n]=o(t,e);return[void 0,i,n]}(e,r,i);let u;return{type:"object",async:!1,entries:t,rest:n,message:s,pipe:p,_parse(t,e){if(!t||"object"!=typeof t)return c(e,"type","object",this.message,t);u=u||Object.entries(this.entries);let r,i=!0;const n={};for(const[s,o]of u){const a=t[s],p=o._parse(a,e);if(p.issues){const n={type:"object",input:t,key:s,value:a};for(const t of p.issues)t.path?t.path.unshift(n):t.path=[n],r?.push(t);if(r||(r=p.issues),e?.abortEarly){i=!1;break}}p.typed||(i=!1),(void 0!==p.output||s in t)&&(n[s]=p.output)}if(this.rest&&(!e?.abortEarly||!r))for(const s in t)if(!(s in this.entries)){const o=t[s],a=this.rest._parse(o,e);if(a.issues){const n={type:"object",input:t,key:s,value:o};for(const t of a.issues)t.path?t.path.unshift(n):t.path=[n],r?.push(t);if(r||(r=a.issues),e?.abortEarly){i=!1;break}}a.typed||(i=!1),n[s]=a.output}return i?f(n,this.pipe,e,"object",r):a(!1,n,r)}}}({id:h,path:h,type:b,baseUrl:h,workspace:b,tool:b});var d;function m(r){const{id:i,path:n,baseUrl:s,tool:o,workspace:a,type:p}=r;if(function(t){return e=t,!g._parse(e,{abortEarly:!0,skipPipe:r?.skipPipe}).issues;var e,r}(r))return[["id",t(i)],["type",p],["path",l(e.fromString(n))],["base",encodeURIComponent(s)],["workspace",a],["tool",o]].filter((([,t])=>!!t)).map((t=>t.join("="))).join(";")}const k=(t,s,o,a)=>{if(!s||!o)return;const p=r(a),u=i({resultPath:p,resultSourceMap:s,studioUrl:o});return u?m({baseUrl:u.baseUrl,workspace:u.workspace,tool:u.tool,type:u.type,id:u.id,path:"string"==typeof u.path?u.path:e.toString(n(u.path))}):void 0};function v(t,r,i){const n=t=>k(0,r,i,t);return n.scope=function(t){const r="string"==typeof t?e.fromString(t):t;return function(t){const i="string"==typeof t?e.fromString(t):t;return n([...r,...i])}},n}export{v as defineEncodeDataAttribute,k as encodeDataAttribute};//# sourceMappingURL=encode-data-attribute.js.map | ||
import{getPublishedId as t,studioPath as e,studioPathToJsonPath as r,resolveEditInfo as i,jsonPathToStudioPath as n}from"@sanity/client/csm";function s(t){return"function"==typeof t?t():t}function o(t,e){return Array.isArray(t)?[void 0,t]:[t,e]}function a(t,e,r){return{typed:t,output:e,issues:r}}function p(t,e){return{reason:t?.reason,validation:e.validation,origin:t?.origin||"value",message:e.message,input:e.input,requirement:e?.requirement,path:e.path,abortEarly:t?.abortEarly,abortPipeEarly:t?.abortPipeEarly,skipPipe:t?.skipPipe}}function u(t,e){return{reason:e,origin:t?.origin,abortEarly:t?.abortEarly,abortPipeEarly:t?.abortPipeEarly,skipPipe:t?.skipPipe}}function f(t,e,r,i,n){let s,o=t;if(e?.length&&!r?.skipPipe)for(const t of e){const e=t._parse(o);if(e.issues){s=s||u(r,i);for(const t of e.issues){const e=p(s,t);n?n.push(e):n=[e]}if(s.abortEarly||s.abortPipeEarly)break}else o=e.output}return a(!0,o,n)}function c(t,e,r,i,n,o,a){return{typed:!1,output:n,issues:[{reason:e,validation:r,origin:t?.origin||"value",message:s(i),input:n,path:o,issues:a,abortEarly:t?.abortEarly,abortPipeEarly:t?.abortPipeEarly,skipPipe:t?.skipPipe}]}}function y(t){return null!==t&&Array.isArray(t)}function l(t){let e="";for(const r of t)"string"!=typeof r?"number"!=typeof r?y(r)?(e&&(e+=":"),e+=`${r.join(",")}}`):r._key&&(e&&(e+=":"),e+=`${r._key}`):(e&&(e+=":"),e+=`${r}`):(e&&(e+="."),e+=r);return e}const h=function(t,e){const[r="Invalid type",i]=o(t,e);return{type:"string",async:!1,message:r,pipe:i,_parse(t,e){return"string"!=typeof t?c(e,"type","string",this.message,t):f(t,this.pipe,e,"string")}}}([function(t,e="Invalid length"){return{type:"min_length",async:!1,message:e,requirement:t,_parse(t){return t.length<this.requirement?function(t,e,r,i,n){return{issues:[{validation:t,message:s(e),input:r,requirement:i,path:n}]}}(this.type,this.message,t,this.requirement):{output:t}}}}(1)]),b={type:"optional",async:!1,wrapped:h,default:d,_parse(t,e){if(void 0===t){const e="function"==typeof(r=this).default?r.default():r.default;if(void 0===e)return a(!0,t);t=e}var r;return this.wrapped._parse(t,e)}},g=function(t,e,r,i){const[n,s="Invalid type",p]=function(t,e,r){if(!t||"object"==typeof t&&!Array.isArray(t)){const[i,n]=o(e,r);return[t,i,n]}const[i,n]=o(t,e);return[void 0,i,n]}(e,r,i);let u;return{type:"object",async:!1,entries:t,rest:n,message:s,pipe:p,_parse(t,e){if(!t||"object"!=typeof t)return c(e,"type","object",this.message,t);u=u||Object.entries(this.entries);let r,i=!0;const n={};for(const[s,o]of u){const a=t[s],p=o._parse(a,e);if(p.issues){const n={type:"object",input:t,key:s,value:a};for(const t of p.issues)t.path?t.path.unshift(n):t.path=[n],r?.push(t);if(r||(r=p.issues),e?.abortEarly){i=!1;break}}p.typed||(i=!1),(void 0!==p.output||s in t)&&(n[s]=p.output)}if(this.rest&&(!e?.abortEarly||!r))for(const s in t)if(!(s in this.entries)){const o=t[s],a=this.rest._parse(o,e);if(a.issues){const n={type:"object",input:t,key:s,value:o};for(const t of a.issues)t.path?t.path.unshift(n):t.path=[n],r?.push(t);if(r||(r=a.issues),e?.abortEarly){i=!1;break}}a.typed||(i=!1),n[s]=a.output}return i?f(n,this.pipe,e,"object",r):a(!1,n,r)}}}({id:h,path:h,type:b,baseUrl:h,workspace:b,tool:b});var d;function m(r){const{id:i,path:n,baseUrl:s,tool:o,workspace:a,type:p}=r;if(function(t){return e=t,!g._parse(e,{abortEarly:!0,skipPipe:r?.skipPipe}).issues;var e,r}(r))return[["id",t(i)],["type",p],["path",l(e.fromString(n))],["base",encodeURIComponent(s)],["workspace",a],["tool",o]].filter((([,t])=>!!t)).map((t=>t.join("="))).join(";")}const k=(t,s,o,a)=>{if(!s||!o)return;const p=r(a),u=i({resultPath:p,resultSourceMap:s,studioUrl:o});return u?m({baseUrl:u.baseUrl,workspace:u.workspace,tool:u.tool,type:u.type,id:u.id,path:"string"==typeof u.path?u.path:e.toString(n(u.path))}):void 0};function v(t,r,i){const n=t=>k(0,r,i,t);return n.scope=function(t){const r="string"==typeof t?e.fromString(t):t;return function(t){const i="string"==typeof t?e.fromString(t):t;return n([...r,...i])}},n}export{v as defineEncodeDataAttribute,k as encodeDataAttribute};//# sourceMappingURL=encode-data-attribute.js.map |
@@ -1,1 +0,1 @@ | ||
import"async-cache-dedupe";export{c as createQueryStore,r as runtime}from"./_chunks/index-Rd_v-ek7.js";//# sourceMappingURL=index.js.map | ||
import"async-cache-dedupe";export{c as createQueryStore,r as runtime}from"./_chunks/index-dWXwxKKR.js";//# sourceMappingURL=index.js.map |
{ | ||
"name": "@sanity/core-loader", | ||
"version": "1.3.2", | ||
"version": "1.3.3", | ||
"homepage": "https://github.com/sanity-io/visual-editing/tree/main/packages/core-loader#readme", | ||
@@ -122,9 +122,9 @@ "bugs": { | ||
"@sanity/client": "^6.10.0", | ||
"@sanity/pkg-utils": "^3.3.5", | ||
"@sanity/visual-editing-helpers": "0.2.0", | ||
"@typescript-eslint/eslint-plugin": "^6.14.0", | ||
"@typescript-eslint/parser": "^6.14.0", | ||
"eslint": "^8.55.0", | ||
"@sanity/pkg-utils": "^3.3.6", | ||
"@sanity/visual-editing-helpers": "0.2.1", | ||
"@typescript-eslint/eslint-plugin": "^6.17.0", | ||
"@typescript-eslint/parser": "^6.17.0", | ||
"eslint": "^8.56.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-prettier": "^5.0.1", | ||
"eslint-plugin-prettier": "^5.1.2", | ||
"eslint-plugin-simple-import-sort": "^10.0.0", | ||
@@ -134,3 +134,3 @@ "happy-dom": "^12.10.3", | ||
"typescript": "^5.3.3", | ||
"vitest": "^1.0.4" | ||
"vitest": "^1.1.1" | ||
}, | ||
@@ -137,0 +137,0 @@ "peerDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
417399