@depup/sanity 5.17.1-depup.0
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/LICENSE +21 -0
- package/README.md +57 -0
- package/bin/sanity +209 -0
- package/changes.json +114 -0
- package/lib/_chunks-dts/ActiveWorkspaceMatcherContext.d.ts +16164 -0
- package/lib/_chunks-dts/index.d.ts +780 -0
- package/lib/_chunks-dts/types.d.ts +2765 -0
- package/lib/_chunks-dts/types2.d.ts +656 -0
- package/lib/_chunks-dts/types3.d.ts +303 -0
- package/lib/_chunks-es/BroadcastDisplayedDocument.js +20 -0
- package/lib/_chunks-es/BroadcastDisplayedDocument.js.map +1 -0
- package/lib/_chunks-es/DisplayedDocumentBroadcaster.js +32 -0
- package/lib/_chunks-es/DisplayedDocumentBroadcaster.js.map +1 -0
- package/lib/_chunks-es/LiveQueries.js +339 -0
- package/lib/_chunks-es/LiveQueries.js.map +1 -0
- package/lib/_chunks-es/MenuGroup.js +106 -0
- package/lib/_chunks-es/MenuGroup.js.map +1 -0
- package/lib/_chunks-es/PostMessageDocuments.js +72 -0
- package/lib/_chunks-es/PostMessageDocuments.js.map +1 -0
- package/lib/_chunks-es/PostMessagePerspective.js +23 -0
- package/lib/_chunks-es/PostMessagePerspective.js.map +1 -0
- package/lib/_chunks-es/PostMessagePreviewSnapshots.js +69 -0
- package/lib/_chunks-es/PostMessagePreviewSnapshots.js.map +1 -0
- package/lib/_chunks-es/PostMessageRefreshMutations.js +74 -0
- package/lib/_chunks-es/PostMessageRefreshMutations.js.map +1 -0
- package/lib/_chunks-es/PostMessageSchema.js +502 -0
- package/lib/_chunks-es/PostMessageSchema.js.map +1 -0
- package/lib/_chunks-es/PostMessageTelemetry.js +21 -0
- package/lib/_chunks-es/PostMessageTelemetry.js.map +1 -0
- package/lib/_chunks-es/PresentationToolGrantsCheck.js +3848 -0
- package/lib/_chunks-es/PresentationToolGrantsCheck.js.map +1 -0
- package/lib/_chunks-es/QRCodeSVG.js +692 -0
- package/lib/_chunks-es/QRCodeSVG.js.map +1 -0
- package/lib/_chunks-es/StructureToolProvider.js +2360 -0
- package/lib/_chunks-es/StructureToolProvider.js.map +1 -0
- package/lib/_chunks-es/VideoPlayer.js +22 -0
- package/lib/_chunks-es/VideoPlayer.js.map +1 -0
- package/lib/_chunks-es/ViteDevServerStopped.js +52 -0
- package/lib/_chunks-es/ViteDevServerStopped.js.map +1 -0
- package/lib/_chunks-es/index.js +285 -0
- package/lib/_chunks-es/index.js.map +1 -0
- package/lib/_chunks-es/index2.js +105 -0
- package/lib/_chunks-es/index2.js.map +1 -0
- package/lib/_chunks-es/index3.js +139 -0
- package/lib/_chunks-es/index3.js.map +1 -0
- package/lib/_chunks-es/index4.js +1020 -0
- package/lib/_chunks-es/index4.js.map +1 -0
- package/lib/_chunks-es/pane.js +5 -0
- package/lib/_chunks-es/pane.js.map +1 -0
- package/lib/_chunks-es/pane2.js +5 -0
- package/lib/_chunks-es/pane2.js.map +1 -0
- package/lib/_chunks-es/presentation.js +549 -0
- package/lib/_chunks-es/presentation.js.map +1 -0
- package/lib/_chunks-es/resources.js +303 -0
- package/lib/_chunks-es/resources.js.map +1 -0
- package/lib/_chunks-es/resources2.js +459 -0
- package/lib/_chunks-es/resources2.js.map +1 -0
- package/lib/_chunks-es/resources3.js +281 -0
- package/lib/_chunks-es/resources3.js.map +1 -0
- package/lib/_chunks-es/resources4.js +184 -0
- package/lib/_chunks-es/resources4.js.map +1 -0
- package/lib/_chunks-es/resources5.js +161 -0
- package/lib/_chunks-es/resources5.js.map +1 -0
- package/lib/_chunks-es/resources6.js +141 -0
- package/lib/_chunks-es/resources6.js.map +1 -0
- package/lib/_chunks-es/resources7.js +24 -0
- package/lib/_chunks-es/resources7.js.map +1 -0
- package/lib/_chunks-es/resources8.js +603 -0
- package/lib/_chunks-es/resources8.js.map +1 -0
- package/lib/_chunks-es/resources9.js +126 -0
- package/lib/_chunks-es/resources9.js.map +1 -0
- package/lib/_chunks-es/structureTool.js +13673 -0
- package/lib/_chunks-es/structureTool.js.map +1 -0
- package/lib/_chunks-es/version.js +17 -0
- package/lib/_chunks-es/version.js.map +1 -0
- package/lib/_createContext.d.ts +12 -0
- package/lib/_createContext.js +38 -0
- package/lib/_createContext.js.map +1 -0
- package/lib/_internal.d.ts +9 -0
- package/lib/_internal.js +12 -0
- package/lib/_internal.js.map +1 -0
- package/lib/_singletons.d.ts +951 -0
- package/lib/_singletons.js +284 -0
- package/lib/_singletons.js.map +1 -0
- package/lib/cli.d.ts +3 -0
- package/lib/cli.js +9 -0
- package/lib/cli.js.map +1 -0
- package/lib/desk.d.ts +910 -0
- package/lib/desk.js +71 -0
- package/lib/desk.js.map +1 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +92934 -0
- package/lib/index.js.map +1 -0
- package/lib/media-library.d.ts +85 -0
- package/lib/media-library.js +11 -0
- package/lib/media-library.js.map +1 -0
- package/lib/migrate.d.ts +1 -0
- package/lib/migrate.js +2 -0
- package/lib/migrate.js.map +1 -0
- package/lib/presentation.d.ts +28 -0
- package/lib/presentation.js +10 -0
- package/lib/presentation.js.map +1 -0
- package/lib/router.d.ts +560 -0
- package/lib/router.js +777 -0
- package/lib/router.js.map +1 -0
- package/lib/structure.d.ts +3 -0
- package/lib/structure.js +639 -0
- package/lib/structure.js.map +1 -0
- package/mock-browser-env-stub-loader.mjs +27 -0
- package/package.json +383 -0
- package/static/favicons/apple-touch-icon.png +0 -0
- package/static/favicons/favicon-192.png +0 -0
- package/static/favicons/favicon-512.png +0 -0
- package/static/favicons/favicon-96.png +0 -0
- package/static/favicons/favicon.ico +0 -0
- package/static/favicons/favicon.svg +12 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var version = "5.17.1";
|
|
2
|
+
let buildVersion;
|
|
3
|
+
try {
|
|
4
|
+
buildVersion = process.env.PKG_BUILD_VERSION;
|
|
5
|
+
} catch {
|
|
6
|
+
}
|
|
7
|
+
try {
|
|
8
|
+
buildVersion = buildVersion || // This is replaced by `@sanity/pkg-utils` at build time
|
|
9
|
+
// and must always be references by its full static name, e.g. no optional chaining, no `if (process && process.env)` etc.
|
|
10
|
+
"5.17.1";
|
|
11
|
+
} catch {
|
|
12
|
+
}
|
|
13
|
+
const SANITY_VERSION = buildVersion || `${version}-dev`;
|
|
14
|
+
export {
|
|
15
|
+
SANITY_VERSION
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sources":["../../src/core/version.ts"],"sourcesContent":["import {version} from '../../package.json'\n\nlet buildVersion: string | undefined\ntry {\n // this offers a way to override what version is displayed\n // currently used for test-studio preview builds to attach custom version details like git info\n buildVersion = process.env.PKG_BUILD_VERSION\n} catch {\n // ignore, assume process.env is not defined by the runtime\n}\n\ntry {\n buildVersion =\n buildVersion ||\n // This is replaced by `@sanity/pkg-utils` at build time\n // and must always be references by its full static name, e.g. no optional chaining, no `if (process && process.env)` etc.\n process.env.PKG_VERSION\n} catch {\n // ignore, assuming process.env is not defined by the runtime\n // note: this should normally not happen when running from a production build built by pkg-utils\n // but could happen when using other build tools or running directly from source, e.g. in a dev or test environment\n}\n\n/**\n * @hidden\n * @beta\n */\nexport const SANITY_VERSION = buildVersion || `${version}-dev`\n"],"names":["buildVersion","process","env","PKG_BUILD_VERSION","SANITY_VERSION","version"],"mappings":";AAEA,IAAIA;AACJ,IAAI;AAGFA,iBAAeC,QAAQC,IAAIC;AAC7B,QAAQ;AACN;AAGF,IAAI;AACFH,iBACEA;AAAAA;AAAAA,EAGA;AACJ,QAAQ;AAGN;AAOK,MAAMI,iBAAiBJ,gBAAgB,GAAGK,OAAO;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Context } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
* @hidden
|
|
5
|
+
*/
|
|
6
|
+
declare function createGlobalScopedContext<ContextType, const T extends ContextType = ContextType>(
|
|
7
|
+
/**
|
|
8
|
+
* It's important to prefix these keys as they are global
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
key: `sanity/_singletons/context/${string}`, defaultValue: T): Context<ContextType>;
|
|
12
|
+
export { createGlobalScopedContext as createContext };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { createContext } from "react";
|
|
2
|
+
import { SANITY_VERSION } from "./_chunks-es/version.js";
|
|
3
|
+
const MISSING_CONTEXT_HELP_URL = "https://www.sanity.io/help/missing-context-error";
|
|
4
|
+
function createGlobalScopedContext(key, defaultValue) {
|
|
5
|
+
const symbol = Symbol.for(key);
|
|
6
|
+
if (typeof document > "u" || typeof window < "u" && typeof window.navigator < "u" && window.navigator.userAgent.includes("jsdom")) {
|
|
7
|
+
const context = createContext(defaultValue);
|
|
8
|
+
return context.displayName = key, context;
|
|
9
|
+
}
|
|
10
|
+
if (!globalScope[symbol])
|
|
11
|
+
globalScope[symbol] = {
|
|
12
|
+
context: createContext(defaultValue),
|
|
13
|
+
version: SANITY_VERSION
|
|
14
|
+
};
|
|
15
|
+
else {
|
|
16
|
+
if (globalScope[symbol].version !== SANITY_VERSION)
|
|
17
|
+
throw new TypeError(`Duplicate instances of context "${key}" with incompatible versions detected: Expected ${SANITY_VERSION} but got ${globalScope[symbol].version}.
|
|
18
|
+
|
|
19
|
+
For more information, please visit ${MISSING_CONTEXT_HELP_URL}`);
|
|
20
|
+
warned.has(SANITY_VERSION) || (console.warn(`Duplicate instances of context "${key}" detected. This is likely a mistake and may cause unexpected behavior.
|
|
21
|
+
|
|
22
|
+
For more information, please visit ${MISSING_CONTEXT_HELP_URL}`), warned.add(SANITY_VERSION));
|
|
23
|
+
}
|
|
24
|
+
return globalScope[symbol].context;
|
|
25
|
+
}
|
|
26
|
+
const warned = /* @__PURE__ */ new Set();
|
|
27
|
+
function getGlobalScope() {
|
|
28
|
+
if (typeof globalThis < "u") return globalThis;
|
|
29
|
+
if (typeof window < "u") return window;
|
|
30
|
+
if (typeof self < "u") return self;
|
|
31
|
+
if (typeof global < "u") return global;
|
|
32
|
+
throw new Error("sanity: could not locate global scope");
|
|
33
|
+
}
|
|
34
|
+
const globalScope = getGlobalScope();
|
|
35
|
+
export {
|
|
36
|
+
createGlobalScopedContext as createContext
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=_createContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_createContext.js","sources":["../src/_createContext/createGlobalScopedContext.ts"],"sourcesContent":["import {type Context, createContext} from 'react'\n\nimport {SANITY_VERSION} from '../core/version'\n\nconst MISSING_CONTEXT_HELP_URL = 'https://www.sanity.io/help/missing-context-error'\n\n/**\n * @internal\n * @hidden\n */\nexport function createGlobalScopedContext<ContextType, const T extends ContextType = ContextType>(\n /**\n * It's important to prefix these keys as they are global\n */\n key: `sanity/_singletons/context/${string}`,\n defaultValue: T,\n): Context<ContextType> {\n const symbol = Symbol.for(key)\n\n /**\n * Prevent errors about re-renders on React SSR on Next.js App Router, as well as JSDOM-based\n * environments such as when we extract schemas etc from the studio configuration.\n */\n if (\n typeof document === 'undefined' ||\n (typeof window !== 'undefined' &&\n typeof window.navigator !== 'undefined' &&\n window.navigator.userAgent.includes('jsdom'))\n ) {\n const context = createContext<ContextType>(defaultValue)\n context.displayName = key\n return context\n }\n\n if (!globalScope[symbol]) {\n globalScope[symbol] = {context: createContext<T>(defaultValue), version: SANITY_VERSION}\n } else if (globalScope[symbol].version !== SANITY_VERSION) {\n throw new TypeError(\n `Duplicate instances of context \"${key}\" with incompatible versions detected: Expected ${SANITY_VERSION} but got ${globalScope[symbol].version}.\\n\\n` +\n `For more information, please visit ${MISSING_CONTEXT_HELP_URL}`,\n )\n } else if (!warned.has(SANITY_VERSION)) {\n console.warn(\n `Duplicate instances of context \"${key}\" detected. This is likely a mistake and may cause unexpected behavior.\\n\\n` +\n `For more information, please visit ${MISSING_CONTEXT_HELP_URL}`,\n )\n warned.add(SANITY_VERSION)\n }\n\n return globalScope[symbol].context\n}\n\nconst warned = new Set<typeof SANITY_VERSION>()\n\n/**\n * Gets the global scope instance in a given environment.\n *\n * The strategy is to return the most modern, and if not, the most common:\n * - The `globalThis` variable is the modern approach to accessing the global scope\n * - The `window` variable is the global scope in a web browser\n * - The `self` variable is the global scope in workers and others\n * - The `global` variable is the global scope in Node.js\n */\nfunction getGlobalScope() {\n if (typeof globalThis !== 'undefined') return globalThis\n if (typeof window !== 'undefined') return window\n if (typeof self !== 'undefined') return self\n if (typeof global !== 'undefined') return global\n\n throw new Error('sanity: could not locate global scope')\n}\n\nconst globalScope = getGlobalScope() as any\n"],"names":["MISSING_CONTEXT_HELP_URL","createGlobalScopedContext","key","defaultValue","symbol","Symbol","for","document","window","navigator","userAgent","includes","context","createContext","displayName","globalScope","version","SANITY_VERSION","TypeError","warned","has","console","warn","add","Set","getGlobalScope","globalThis","self","global","Error"],"mappings":";;AAIA,MAAMA,2BAA2B;AAM1B,SAASC,0BAIdC,KACAC,cACsB;AACtB,QAAMC,SAASC,OAAOC,IAAIJ,GAAG;AAM7B,MACE,OAAOK,WAAa,OACnB,OAAOC,SAAW,OACjB,OAAOA,OAAOC,YAAc,OAC5BD,OAAOC,UAAUC,UAAUC,SAAS,OAAO,GAC7C;AACA,UAAMC,UAAUC,cAA2BV,YAAY;AACvDS,WAAAA,QAAQE,cAAcZ,KACfU;AAAAA,EACT;AAEA,MAAI,CAACG,YAAYX,MAAM;AACrBW,gBAAYX,MAAM,IAAI;AAAA,MAACQ,SAASC,cAAiBV,YAAY;AAAA,MAAGa,SAASC;AAAAA,IAAAA;AAAAA,OACpE;AAAA,QAAIF,YAAYX,MAAM,EAAEY,YAAYC;AACzC,YAAM,IAAIC,UACR,mCAAmChB,GAAG,mDAAmDe,cAAc,YAAYF,YAAYX,MAAM,EAAEY,OAAO;AAAA;AAAA,qCACtGhB,wBAAwB,EAClE;AACUmB,WAAOC,IAAIH,cAAc,MACnCI,QAAQC,KACN,mCAAmCpB,GAAG;AAAA;AAAA,qCACEF,wBAAwB,EAClE,GACAmB,OAAOI,IAAIN,cAAc;AAAA,EAAA;AAG3B,SAAOF,YAAYX,MAAM,EAAEQ;AAC7B;AAEA,MAAMO,6BAAaK,IAAAA;AAWnB,SAASC,iBAAiB;AACxB,MAAI,OAAOC,aAAe,IAAa,QAAOA;AAC9C,MAAI,OAAOlB,SAAW,IAAa,QAAOA;AAC1C,MAAI,OAAOmB,OAAS,IAAa,QAAOA;AACxC,MAAI,OAAOC,SAAW,IAAa,QAAOA;AAE1C,QAAM,IAAIC,MAAM,uCAAuC;AACzD;AAEA,MAAMd,cAAcU,eAAAA;"}
|
package/lib/_internal.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const HELP_URL = "https://www.sanity.io/docs/help/sanity-cli-sanity-studio-mismatch", cliProjectCommands = {
|
|
2
|
+
requiredCliVersionRange: "^3.0.0 || ^4.0.0 || ^5.0.0",
|
|
3
|
+
commands: new Proxy([], {
|
|
4
|
+
get() {
|
|
5
|
+
throw new Error(`The installed version of "@sanity/cli" is not compatible with the installed version of "sanity". For more information on how to resolve this, see ${HELP_URL}`);
|
|
6
|
+
}
|
|
7
|
+
})
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
cliProjectCommands
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=_internal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_internal.js","sources":["../src/_internal/index.ts"],"sourcesContent":["/**\n * This export is provided for backwards \"compatibility\" with older versions of the CLI,\n * but will throw an error if accessed. The error message should be helpful and\n * point users to the documentation.\n */\nconst HELP_URL = `https://www.sanity.io/docs/help/sanity-cli-sanity-studio-mismatch`\n\n/**\n * This export is server-side only and not importable in a browser.\n * @internal\n */\nexport const cliProjectCommands: {\n // Actually unused since v3 was released, but kept for type compatibility\n requiredCliVersionRange: string\n // actually `CliCommandDefinition | CliCommandGroupDefinition` but avoiding the import\n commands: Array<unknown>\n} = {\n requiredCliVersionRange: '^3.0.0 || ^4.0.0 || ^5.0.0',\n commands: new Proxy([], {\n get() {\n throw new Error(\n `The installed version of \"@sanity/cli\" is not compatible with the installed version of \"sanity\". ` +\n `For more information on how to resolve this, see ${HELP_URL}`,\n )\n },\n }),\n}\n"],"names":["HELP_URL","cliProjectCommands","requiredCliVersionRange","commands","Proxy","get","Error"],"mappings":"AAKA,MAAMA,WAAW,qEAMJC,qBAKT;AAAA,EACFC,yBAAyB;AAAA,EACzBC,UAAU,IAAIC,MAAM,IAAI;AAAA,IACtBC,MAAM;AACJ,YAAM,IAAIC,MACR,qJACsDN,QAAQ,EAChE;AAAA,IACF;AAAA,EAAA,CACD;AACH;"}
|