@acdh-oeaw/keystatic-lib 0.6.1 → 0.7.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.
Files changed (51) hide show
  1. package/dist/_virtual/rolldown_runtime.js +27 -0
  2. package/dist/config.d.ts +6 -5
  3. package/dist/config.js +1 -3
  4. package/dist/create-asset-options.d.ts +7 -7
  5. package/dist/create-asset-options.js +15 -2
  6. package/dist/create-asset-options.js.map +1 -1
  7. package/dist/create-component.d.ts +6 -5
  8. package/dist/create-component.js +9 -2
  9. package/dist/create-component.js.map +1 -1
  10. package/dist/create-content-field-options.d.ts +10 -10
  11. package/dist/create-content-field-options.js +19 -3
  12. package/dist/create-content-field-options.js.map +1 -1
  13. package/dist/create-label.d.ts +4 -2
  14. package/dist/create-label.js +7 -2
  15. package/dist/create-label.js.map +1 -1
  16. package/dist/index.d.ts +8 -9
  17. package/dist/index.js +8 -8
  18. package/dist/node_modules/.pnpm/react@19.1.1/node_modules/react/cjs/react.development.js +718 -0
  19. package/dist/node_modules/.pnpm/react@19.1.1/node_modules/react/cjs/react.development.js.map +1 -0
  20. package/dist/node_modules/.pnpm/react@19.1.1/node_modules/react/cjs/react.production.js +354 -0
  21. package/dist/node_modules/.pnpm/react@19.1.1/node_modules/react/cjs/react.production.js.map +1 -0
  22. package/dist/node_modules/.pnpm/react@19.1.1/node_modules/react/index.js +15 -0
  23. package/dist/node_modules/.pnpm/react@19.1.1/node_modules/react/index.js.map +1 -0
  24. package/dist/preview/index.d.ts +7 -5
  25. package/dist/preview/index.js +21 -20
  26. package/dist/preview/index.js.map +1 -1
  27. package/dist/reader.d.ts +41 -39
  28. package/dist/reader.js +85 -86
  29. package/dist/reader.js.map +1 -1
  30. package/dist/resources.d.ts +14 -12
  31. package/dist/resources.js +34 -2
  32. package/dist/resources.js.map +1 -1
  33. package/dist/with-i18n-prefix.d.ts +5 -3
  34. package/dist/with-i18n-prefix.js +7 -2
  35. package/dist/with-i18n-prefix.js.map +1 -1
  36. package/license +1 -1
  37. package/package.json +44 -33
  38. package/dist/chunk-CI4JBTGG.js +0 -8
  39. package/dist/chunk-CI4JBTGG.js.map +0 -1
  40. package/dist/chunk-EEB35F4L.js +0 -15
  41. package/dist/chunk-EEB35F4L.js.map +0 -1
  42. package/dist/chunk-ENT7N2ZS.js +0 -16
  43. package/dist/chunk-ENT7N2ZS.js.map +0 -1
  44. package/dist/chunk-M7J4ISS4.js +0 -8
  45. package/dist/chunk-M7J4ISS4.js.map +0 -1
  46. package/dist/chunk-ZN3LEWB6.js +0 -35
  47. package/dist/chunk-ZN3LEWB6.js.map +0 -1
  48. package/dist/chunk-ZWZCXCMD.js +0 -10
  49. package/dist/chunk-ZWZCXCMD.js.map +0 -1
  50. package/dist/config.js.map +0 -1
  51. package/dist/index.js.map +0 -1
@@ -1,8 +0,0 @@
1
- // src/create-label.ts
2
- function createLabel(label, locale) {
3
- return `${label} (${locale})`;
4
- }
5
-
6
- export { createLabel };
7
- //# sourceMappingURL=chunk-CI4JBTGG.js.map
8
- //# sourceMappingURL=chunk-CI4JBTGG.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/create-label.ts"],"names":[],"mappings":";AAEO,SAAS,WAAA,CAAY,OAAe,MAAgB,EAAA;AAC1D,EAAO,OAAA,CAAA,EAAG,KAAK,CAAA,EAAA,EAAK,MAAM,CAAA,CAAA,CAAA;AAC3B","file":"chunk-CI4JBTGG.js","sourcesContent":["import type { Locale } from \"./config\";\n\nexport function createLabel(label: string, locale: Locale) {\n\treturn `${label} (${locale})`;\n}\n"]}
@@ -1,15 +0,0 @@
1
- import { createAssetOptions } from './chunk-ENT7N2ZS.js';
2
-
3
- // src/create-content-field-options.ts
4
- function createContentFieldOptions(paths) {
5
- const assetPaths = createAssetOptions(paths.assetPath);
6
- const headingLevels = [2, 3, 4, 5];
7
- return {
8
- heading: headingLevels,
9
- image: assetPaths
10
- };
11
- }
12
-
13
- export { createContentFieldOptions };
14
- //# sourceMappingURL=chunk-EEB35F4L.js.map
15
- //# sourceMappingURL=chunk-EEB35F4L.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/create-content-field-options.ts"],"names":[],"mappings":";;;AAGO,SAAS,0BAAuD,KAAqB,EAAA;AAC3F,EAAM,MAAA,UAAA,GAAa,kBAAmB,CAAA,KAAA,CAAM,SAAS,CAAA;AACrD,EAAA,MAAM,aAAgB,GAAA,CAAC,CAAG,EAAA,CAAA,EAAG,GAAG,CAAC,CAAA;AAEjC,EAAO,OAAA;AAAA,IACN,OAAS,EAAA,aAAA;AAAA,IACT,KAAO,EAAA;AAAA,GACR;AACD","file":"chunk-EEB35F4L.js","sourcesContent":["import { createAssetOptions } from \"./create-asset-options\";\nimport type { Paths } from \"./resources\";\n\nexport function createContentFieldOptions<TPath extends `/${string}/`>(paths: Paths<TPath>) {\n\tconst assetPaths = createAssetOptions(paths.assetPath);\n\tconst headingLevels = [2, 3, 4, 5] as const;\n\n\treturn {\n\t\theading: headingLevels,\n\t\timage: assetPaths,\n\t};\n}\n"]}
@@ -1,16 +0,0 @@
1
- import slugify from '@sindresorhus/slugify';
2
-
3
- // src/create-asset-options.ts
4
- function createAssetOptions(path) {
5
- return {
6
- directory: `./public/assets${path}`,
7
- publicPath: `/assets${path}`,
8
- transformFilename(originalFilename) {
9
- return slugify(originalFilename, { preserveCharacters: ["."] });
10
- }
11
- };
12
- }
13
-
14
- export { createAssetOptions };
15
- //# sourceMappingURL=chunk-ENT7N2ZS.js.map
16
- //# sourceMappingURL=chunk-ENT7N2ZS.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/create-asset-options.ts"],"names":[],"mappings":";;;AAIO,SAAS,mBACf,IACC,EAAA;AACD,EAAO,OAAA;AAAA,IACN,SAAA,EAAW,kBAAkB,IAAI,CAAA,CAAA;AAAA,IACjC,UAAA,EAAY,UAAU,IAAI,CAAA,CAAA;AAAA,IAC1B,kBAAkB,gBAA0B,EAAA;AAC3C,MAAA,OAAO,QAAQ,gBAAkB,EAAA,EAAE,oBAAoB,CAAC,GAAG,GAAG,CAAA;AAAA;AAC/D,GACD;AACD","file":"chunk-ENT7N2ZS.js","sourcesContent":["import slugify from \"@sindresorhus/slugify\";\n\nimport type { Paths } from \"./resources\";\n\nexport function createAssetOptions<TPath extends `/${string}/`>(\n\tpath: Paths<TPath>[\"assetPath\"] | Paths<TPath>[\"downloadPath\"],\n) {\n\treturn {\n\t\tdirectory: `./public/assets${path}` as const,\n\t\tpublicPath: `/assets${path}` as const,\n\t\ttransformFilename(originalFilename: string) {\n\t\t\treturn slugify(originalFilename, { preserveCharacters: [\".\"] });\n\t\t},\n\t};\n}\n"]}
@@ -1,8 +0,0 @@
1
- // src/with-i18n-prefix.ts
2
- function withI18nPrefix(label, locale) {
3
- return `${locale}:${label}`;
4
- }
5
-
6
- export { withI18nPrefix };
7
- //# sourceMappingURL=chunk-M7J4ISS4.js.map
8
- //# sourceMappingURL=chunk-M7J4ISS4.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/with-i18n-prefix.ts"],"names":[],"mappings":";AAEO,SAAS,cAAA,CACf,OACA,MACC,EAAA;AACD,EAAO,OAAA,CAAA,EAAG,MAAM,CAAA,CAAA,EAAI,KAAK,CAAA,CAAA;AAC1B","file":"chunk-M7J4ISS4.js","sourcesContent":["import type { Locale } from \"./config\";\n\nexport function withI18nPrefix<TLabel extends string, TLocale extends Locale>(\n\tlabel: TLabel,\n\tlocale: TLocale,\n) {\n\treturn `${locale}:${label}` as const;\n}\n\nexport type WithoutI18nPrefix<\n\tT extends string,\n\tTLocale extends Locale,\n> = T extends `${TLocale}:${infer U}` ? U : T;\n"]}
@@ -1,35 +0,0 @@
1
- // src/resources.ts
2
- function createPaths(path, locale) {
3
- return {
4
- assetPath: `/content/assets/${locale}${path}`,
5
- downloadPath: `/content/downloads/${locale}${path}`
6
- };
7
- }
8
- function createCollectionPaths(path, locale) {
9
- return {
10
- ...createPaths(path, locale),
11
- contentPath: `./content/${locale}${path}*/`
12
- };
13
- }
14
- function createSingletonPaths(path, locale) {
15
- return {
16
- ...createPaths(path, locale),
17
- contentPath: `./content/${locale}${path}`
18
- };
19
- }
20
- function createCollection(path, createLocalisedCollectionFactory) {
21
- return function createLocalisedCollection(locale) {
22
- const paths = createCollectionPaths(path, locale);
23
- return createLocalisedCollectionFactory(paths, locale);
24
- };
25
- }
26
- function createSingleton(path, createLocalisedSingletonFactory) {
27
- return function createLocalisedSingleton(locale) {
28
- const paths = createSingletonPaths(path, locale);
29
- return createLocalisedSingletonFactory(paths, locale);
30
- };
31
- }
32
-
33
- export { createCollection, createCollectionPaths, createPaths, createSingleton, createSingletonPaths };
34
- //# sourceMappingURL=chunk-ZN3LEWB6.js.map
35
- //# sourceMappingURL=chunk-ZN3LEWB6.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/resources.ts"],"names":[],"mappings":";AAIO,SAAS,WAAA,CAAyC,MAAa,MAAgB,EAAA;AACrF,EAAO,OAAA;AAAA,IACN,SAAW,EAAA,CAAA,gBAAA,EAAmB,MAAM,CAAA,EAAG,IAAI,CAAA,CAAA;AAAA,IAC3C,YAAc,EAAA,CAAA,mBAAA,EAAsB,MAAM,CAAA,EAAG,IAAI,CAAA;AAAA,GAClD;AACD;AAIO,SAAS,qBAAA,CAAmD,MAAa,MAAgB,EAAA;AAC/F,EAAO,OAAA;AAAA,IACN,GAAG,WAAY,CAAA,IAAA,EAAM,MAAM,CAAA;AAAA,IAC3B,WAAa,EAAA,CAAA,UAAA,EAAa,MAAM,CAAA,EAAG,IAAI,CAAA,EAAA;AAAA,GACxC;AACD;AAEO,SAAS,oBAAA,CAAkD,MAAa,MAAgB,EAAA;AAC9F,EAAO,OAAA;AAAA,IACN,GAAG,WAAY,CAAA,IAAA,EAAM,MAAM,CAAA;AAAA,IAC3B,WAAa,EAAA,CAAA,UAAA,EAAa,MAAM,CAAA,EAAG,IAAI,CAAA;AAAA,GACxC;AACD;AAEO,SAAS,gBAAA,CAMf,MACA,gCAIC,EAAA;AACD,EAAO,OAAA,SAAS,0BAA0B,MAAiB,EAAA;AAC1D,IAAM,MAAA,KAAA,GAAQ,qBAAsB,CAAA,IAAA,EAAM,MAAM,CAAA;AAChD,IAAO,OAAA,gCAAA,CAAiC,OAAO,MAAM,CAAA;AAAA,GACtD;AACD;AAEO,SAAS,eAAA,CAKf,MACA,+BAIC,EAAA;AACD,EAAO,OAAA,SAAS,yBAAyB,MAAiB,EAAA;AACzD,IAAM,MAAA,KAAA,GAAQ,oBAAqB,CAAA,IAAA,EAAM,MAAM,CAAA;AAC/C,IAAO,OAAA,+BAAA,CAAgC,OAAO,MAAM,CAAA;AAAA,GACrD;AACD","file":"chunk-ZN3LEWB6.js","sourcesContent":["import type { Collection, ComponentSchema, Singleton } from \"@keystatic/core\";\n\nimport type { Locale } from \"./config\";\n\nexport function createPaths<TPath extends `/${string}/`>(path: TPath, locale: Locale) {\n\treturn {\n\t\tassetPath: `/content/assets/${locale}${path}`,\n\t\tdownloadPath: `/content/downloads/${locale}${path}`,\n\t} as const;\n}\n\nexport type Paths<TPath extends `/${string}/`> = ReturnType<typeof createPaths<TPath>>;\n\nexport function createCollectionPaths<TPath extends `/${string}/`>(path: TPath, locale: Locale) {\n\treturn {\n\t\t...createPaths(path, locale),\n\t\tcontentPath: `./content/${locale}${path}*/`,\n\t} as const;\n}\n\nexport function createSingletonPaths<TPath extends `/${string}/`>(path: TPath, locale: Locale) {\n\treturn {\n\t\t...createPaths(path, locale),\n\t\tcontentPath: `./content/${locale}${path}`,\n\t} as const;\n}\n\nexport function createCollection<\n\tTPath extends `/${string}/`,\n\tTLocale extends Locale,\n\tTSchema extends Record<string, ComponentSchema>,\n\tTSlugField extends string,\n>(\n\tpath: TPath,\n\tcreateLocalisedCollectionFactory: (\n\t\tpaths: ReturnType<typeof createCollectionPaths<TPath>>,\n\t\tlocale: TLocale,\n\t) => Collection<TSchema, TSlugField>,\n) {\n\treturn function createLocalisedCollection(locale: TLocale) {\n\t\tconst paths = createCollectionPaths(path, locale);\n\t\treturn createLocalisedCollectionFactory(paths, locale);\n\t};\n}\n\nexport function createSingleton<\n\tTPath extends `/${string}/`,\n\tTLocale extends Locale,\n\tTSchema extends Record<string, ComponentSchema>,\n>(\n\tpath: TPath,\n\tcreateLocalisedSingletonFactory: (\n\t\tpaths: ReturnType<typeof createSingletonPaths<TPath>>,\n\t\tlocale: TLocale,\n\t) => Singleton<TSchema>,\n) {\n\treturn function createLocalisedSingleton(locale: TLocale) {\n\t\tconst paths = createSingletonPaths(path, locale);\n\t\treturn createLocalisedSingletonFactory(paths, locale);\n\t};\n}\n"]}
@@ -1,10 +0,0 @@
1
- // src/create-component.ts
2
- function createComponent(createComponentFactory) {
3
- return function createComponent2(paths, locale) {
4
- return createComponentFactory(paths, locale);
5
- };
6
- }
7
-
8
- export { createComponent };
9
- //# sourceMappingURL=chunk-ZWZCXCMD.js.map
10
- //# sourceMappingURL=chunk-ZWZCXCMD.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/create-component.ts"],"names":["createComponent"],"mappings":";AAKO,SAAS,gBAId,sBAA+E,EAAA;AAChF,EAAO,OAAA,SAASA,gBAAgB,CAAA,KAAA,EAAqB,MAAiB,EAAA;AACrE,IAAO,OAAA,sBAAA,CAAuB,OAAO,MAAM,CAAA;AAAA,GAC5C;AACD","file":"chunk-ZWZCXCMD.js","sourcesContent":["import type { ContentComponent } from \"@keystatic/core/content-components\";\n\nimport type { Locale } from \"./config\";\nimport type { Paths } from \"./resources\";\n\nexport function createComponent<\n\tTPath extends `/${string}/`,\n\tTLocale extends Locale,\n\tTComponents extends Record<string, ContentComponent>,\n>(createComponentFactory: (paths: Paths<TPath>, locale: TLocale) => TComponents) {\n\treturn function createComponent(paths: Paths<TPath>, locale: TLocale) {\n\t\treturn createComponentFactory(paths, locale);\n\t};\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"config.js"}
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}