@contember/create 2.0.0-alpha.9 → 2.0.0-beta.1

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 (146) hide show
  1. package/dist/development/run.cjs +0 -2
  2. package/dist/development/run.cjs.map +1 -1
  3. package/dist/development/run.js +0 -2
  4. package/dist/development/run.js.map +1 -1
  5. package/dist/development/src/commands/WorkspaceCreateCommand.cjs.map +1 -1
  6. package/dist/development/src/commands/WorkspaceCreateCommand.js.map +1 -1
  7. package/dist/development/src/lib/FileSystem.cjs.map +1 -1
  8. package/dist/development/src/lib/FileSystem.js.map +1 -1
  9. package/dist/development/src/lib/TemplateInstaller.cjs +1 -8
  10. package/dist/development/src/lib/TemplateInstaller.cjs.map +1 -1
  11. package/dist/development/src/lib/TemplateInstaller.js +2 -9
  12. package/dist/development/src/lib/TemplateInstaller.js.map +1 -1
  13. package/dist/development/src/lib/version.cjs.map +1 -1
  14. package/dist/development/src/paths.cjs +3 -1
  15. package/dist/development/src/paths.cjs.map +1 -1
  16. package/dist/development/src/paths.js +4 -2
  17. package/dist/development/src/paths.js.map +1 -1
  18. package/dist/production/run.cjs +0 -2
  19. package/dist/production/run.cjs.map +1 -1
  20. package/dist/production/run.js +0 -2
  21. package/dist/production/run.js.map +1 -1
  22. package/dist/production/src/commands/WorkspaceCreateCommand.cjs.map +1 -1
  23. package/dist/production/src/commands/WorkspaceCreateCommand.js.map +1 -1
  24. package/dist/production/src/lib/FileSystem.cjs.map +1 -1
  25. package/dist/production/src/lib/FileSystem.js.map +1 -1
  26. package/dist/production/src/lib/TemplateInstaller.cjs +1 -8
  27. package/dist/production/src/lib/TemplateInstaller.cjs.map +1 -1
  28. package/dist/production/src/lib/TemplateInstaller.js +2 -9
  29. package/dist/production/src/lib/TemplateInstaller.js.map +1 -1
  30. package/dist/production/src/lib/version.cjs.map +1 -1
  31. package/dist/production/src/paths.cjs +3 -1
  32. package/dist/production/src/paths.cjs.map +1 -1
  33. package/dist/production/src/paths.js +4 -2
  34. package/dist/production/src/paths.js.map +1 -1
  35. package/dist/types/lib/TemplateInstaller.d.ts +1 -3
  36. package/dist/types/lib/TemplateInstaller.d.ts.map +1 -1
  37. package/dist/types/paths.d.ts.map +1 -1
  38. package/dist/types/tsconfig.tsbuildinfo +1 -1
  39. package/package.json +7 -31
  40. package/resources/templates/template-workspace/.github/scripts/setup-actions-variables.sh +36 -0
  41. package/resources/templates/template-workspace/.github/workflows/deploy.yaml +23 -0
  42. package/resources/templates/template-workspace/admin/lib/binding/binding.tsx +12 -2
  43. package/resources/templates/template-workspace/admin/lib/binding/delete.tsx +34 -23
  44. package/resources/templates/template-workspace/admin/lib/binding/hooks.tsx +5 -6
  45. package/resources/templates/template-workspace/admin/lib/binding/identity.tsx +34 -3
  46. package/resources/templates/template-workspace/admin/lib/binding/navigation-guard-dialog.tsx +39 -0
  47. package/resources/templates/template-workspace/admin/lib/binding/persist.tsx +10 -60
  48. package/resources/templates/template-workspace/admin/lib/block-repeater/block-repeater.tsx +109 -39
  49. package/resources/templates/template-workspace/admin/lib/buttons/link-back-button.tsx +1 -1
  50. package/resources/templates/template-workspace/admin/lib/datagrid/cells.tsx +90 -10
  51. package/resources/templates/template-workspace/admin/lib/datagrid/column-header.tsx +12 -4
  52. package/resources/templates/template-workspace/admin/lib/datagrid/column-leaf.tsx +21 -0
  53. package/resources/templates/template-workspace/admin/lib/datagrid/columns.tsx +367 -36
  54. package/resources/templates/template-workspace/admin/lib/datagrid/elements.tsx +6 -0
  55. package/resources/templates/template-workspace/admin/lib/datagrid/export.tsx +9 -0
  56. package/resources/templates/template-workspace/admin/lib/datagrid/filters/boolean.tsx +22 -5
  57. package/resources/templates/template-workspace/admin/lib/datagrid/filters/common.tsx +3 -0
  58. package/resources/templates/template-workspace/admin/lib/datagrid/filters/date.tsx +25 -2
  59. package/resources/templates/template-workspace/admin/lib/datagrid/filters/defined.tsx +103 -0
  60. package/resources/templates/template-workspace/admin/lib/datagrid/filters/enum.tsx +83 -27
  61. package/resources/templates/template-workspace/admin/lib/datagrid/filters/index.ts +1 -1
  62. package/resources/templates/template-workspace/admin/lib/datagrid/filters/mobile.tsx +0 -1
  63. package/resources/templates/template-workspace/admin/lib/datagrid/filters/number.tsx +21 -5
  64. package/resources/templates/template-workspace/admin/lib/datagrid/filters/relation.tsx +170 -43
  65. package/resources/templates/template-workspace/admin/lib/datagrid/filters/text.tsx +48 -5
  66. package/resources/templates/template-workspace/admin/lib/datagrid/grid.tsx +97 -25
  67. package/resources/templates/template-workspace/admin/lib/datagrid/index.ts +30 -4
  68. package/resources/templates/template-workspace/admin/lib/datagrid/labels.tsx +31 -0
  69. package/resources/templates/template-workspace/admin/lib/datagrid/layout-switcher.tsx +3 -0
  70. package/resources/templates/template-workspace/admin/lib/datagrid/loader.tsx +44 -2
  71. package/resources/templates/template-workspace/admin/lib/datagrid/pagination.tsx +8 -0
  72. package/resources/templates/template-workspace/admin/lib/datagrid/table.tsx +15 -1
  73. package/resources/templates/template-workspace/admin/lib/datagrid/tiles.tsx +13 -0
  74. package/resources/templates/template-workspace/admin/lib/datagrid/toolbar.tsx +27 -2
  75. package/resources/templates/template-workspace/admin/lib/dict.ts +54 -5
  76. package/resources/templates/template-workspace/admin/lib/dimensions/dimensions.tsx +1 -1
  77. package/resources/templates/template-workspace/admin/lib/editor/common/editor-canvas.tsx +2 -2
  78. package/resources/templates/template-workspace/admin/lib/editor/index.ts +1 -0
  79. package/resources/templates/template-workspace/admin/lib/editor/rich-text-view.tsx +17 -0
  80. package/resources/templates/template-workspace/admin/lib/field/formatted-field.tsx +10 -0
  81. package/resources/templates/template-workspace/admin/lib/field/index.ts +1 -0
  82. package/resources/templates/template-workspace/admin/lib/form/container.tsx +43 -45
  83. package/resources/templates/template-workspace/admin/lib/form/index.ts +1 -0
  84. package/resources/templates/template-workspace/admin/lib/form/inputs.tsx +56 -23
  85. package/resources/templates/template-workspace/admin/lib/form/select.tsx +61 -30
  86. package/resources/templates/template-workspace/admin/lib/form/ui.tsx +11 -2
  87. package/resources/templates/template-workspace/admin/lib/form/upload-repeaters.tsx +188 -0
  88. package/resources/templates/template-workspace/admin/lib/form/upload.tsx +57 -242
  89. package/resources/templates/template-workspace/admin/lib/formatting/formatting.ts +23 -0
  90. package/resources/templates/template-workspace/admin/lib/labels/enum-labels.ts +9 -0
  91. package/resources/templates/template-workspace/admin/lib/labels/field-labels.ts +7 -0
  92. package/resources/templates/template-workspace/admin/lib/labels/index.ts +2 -0
  93. package/resources/templates/template-workspace/admin/lib/layout/layout.tsx +3 -3
  94. package/resources/templates/template-workspace/admin/lib/repeater/repeater.tsx +97 -64
  95. package/resources/templates/template-workspace/admin/lib/select/filter.tsx +3 -2
  96. package/resources/templates/template-workspace/admin/lib/select/index.ts +0 -1
  97. package/resources/templates/template-workspace/admin/lib/select/list.tsx +78 -26
  98. package/resources/templates/template-workspace/admin/lib/select/multi-select.tsx +12 -19
  99. package/resources/templates/template-workspace/admin/lib/select/select.tsx +40 -23
  100. package/resources/templates/template-workspace/admin/lib/select/sortable-select.tsx +23 -18
  101. package/resources/templates/template-workspace/admin/lib/select/ui.tsx +3 -0
  102. package/resources/templates/template-workspace/admin/lib/tenant/forms/invite.tsx +5 -3
  103. package/resources/templates/template-workspace/admin/lib/tenant/forms/memberships-control.tsx +28 -16
  104. package/resources/templates/template-workspace/admin/lib/tenant/forms/password-reset.tsx +9 -6
  105. package/resources/templates/template-workspace/admin/lib/tenant/forms/passwordless-signin-init.tsx +31 -0
  106. package/resources/templates/template-workspace/admin/lib/tenant/forms/passwordless-signin.tsx +59 -0
  107. package/resources/templates/template-workspace/admin/lib/tenant/forms/update-project-member.tsx +5 -3
  108. package/resources/templates/template-workspace/admin/lib/tenant/hooks/useInvite.ts +1 -1
  109. package/resources/templates/template-workspace/admin/lib/tenant/listing/member-list.tsx +6 -5
  110. package/resources/templates/template-workspace/admin/lib/tenant/listing/person-list.tsx +2 -1
  111. package/resources/templates/template-workspace/admin/lib/ui/alert-dialog.tsx +2 -1
  112. package/resources/templates/template-workspace/admin/lib/ui/collapsible.tsx +9 -0
  113. package/resources/templates/template-workspace/admin/lib/ui/dialog.tsx +2 -1
  114. package/resources/templates/template-workspace/admin/lib/ui/dropdown.tsx +2 -1
  115. package/resources/templates/template-workspace/admin/lib/ui/input.tsx +14 -10
  116. package/resources/templates/template-workspace/admin/lib/ui/menu.tsx +2 -3
  117. package/resources/templates/template-workspace/admin/lib/ui/popover.tsx +2 -1
  118. package/resources/templates/template-workspace/admin/lib/ui/property-list.tsx +33 -0
  119. package/resources/templates/template-workspace/admin/lib/ui/select.tsx +80 -0
  120. package/resources/templates/template-workspace/admin/lib/ui/sheet.tsx +3 -2
  121. package/resources/templates/template-workspace/admin/lib/ui/textarea.tsx +9 -1
  122. package/resources/templates/template-workspace/admin/lib/upload/view.tsx +160 -165
  123. package/resources/templates/template-workspace/admin/lib/utils/createComponentOpenHooks.tsx +38 -0
  124. package/resources/templates/template-workspace/admin/lib/utils/uic.tsx +3 -3
  125. package/resources/templates/template-workspace/admin/package.json +21 -20
  126. package/resources/templates/template-workspace/package.json +3 -3
  127. package/src/lib/TemplateInstaller.ts +2 -9
  128. package/src/paths.ts +4 -3
  129. package/src/run.ts +0 -2
  130. package/tsconfig.settings.json +0 -4
  131. package/dist/development/src/lib/PackageDownloader.cjs +0 -33
  132. package/dist/development/src/lib/PackageDownloader.cjs.map +0 -1
  133. package/dist/development/src/lib/PackageDownloader.js +0 -33
  134. package/dist/development/src/lib/PackageDownloader.js.map +0 -1
  135. package/dist/production/src/lib/PackageDownloader.cjs +0 -33
  136. package/dist/production/src/lib/PackageDownloader.cjs.map +0 -1
  137. package/dist/production/src/lib/PackageDownloader.js +0 -33
  138. package/dist/production/src/lib/PackageDownloader.js.map +0 -1
  139. package/dist/types/lib/PackageDownloader.d.ts +0 -7
  140. package/dist/types/lib/PackageDownloader.d.ts.map +0 -1
  141. package/resources/templates/template-workspace/admin/.env.production +0 -3
  142. package/resources/templates/template-workspace/admin/lib/select/pagination.tsx +0 -48
  143. package/src/lib/PackageDownloader.ts +0 -33
  144. package/types/download-tarball/index.d.ts +0 -7
  145. package/types/get-package-json-from-registry/index.d.ts +0 -3
  146. package/types/registry-info/index.d.ts +0 -7
@@ -1,33 +0,0 @@
1
- import npa from "npm-package-arg";
2
- import getRegistryInfo from "registry-info";
3
- import getPackageJson from "get-package-json-from-registry";
4
- import { join } from "node:path";
5
- import downloadTarball from "download-tarball";
6
- var __defProp = Object.defineProperty;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __publicField = (obj, key, value) => __defNormalProp(obj, key + "", value);
9
- class PackageDownloader {
10
- constructor(fs) {
11
- this.fs = fs;
12
- __publicField(this, "downloadPackage", async (pkgName) => {
13
- const { scope } = npa(pkgName);
14
- const { authorization } = getRegistryInfo(scope);
15
- const headers = authorization ? { authorization } : {};
16
- const pkg = await getPackageJson(pkgName);
17
- const {
18
- dist: { tarball }
19
- } = pkg;
20
- const tmpDir = await this.fs.createTempDir();
21
- await downloadTarball({ url: tarball, gotOpts: { headers }, dir: tmpDir });
22
- const dirContent = await this.fs.readDir(tmpDir);
23
- if (dirContent.length !== 1 || dirContent[0] !== "package") {
24
- throw "Invalid NPM package";
25
- }
26
- return join(tmpDir, "package");
27
- });
28
- }
29
- }
30
- export {
31
- PackageDownloader
32
- };
33
- //# sourceMappingURL=PackageDownloader.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PackageDownloader.js","sources":["../../../../../packages/create/src/lib/PackageDownloader.ts"],"sourcesContent":["import npa from 'npm-package-arg'\nimport getRegistryInfo from 'registry-info'\nimport getPackageJson from 'get-package-json-from-registry'\nimport { join } from 'node:path'\nimport downloadTarball from 'download-tarball'\nimport { FileSystem } from './FileSystem'\n\nexport class PackageDownloader {\n\n\tconstructor(\n\t\tprivate readonly fs: FileSystem,\n\t) {\n\t}\n\n\tdownloadPackage = async (pkgName: string): Promise<string> => {\n\t\tconst { scope } = npa(pkgName)\n\t\tconst { authorization } = getRegistryInfo(scope)\n\t\tconst headers = authorization ? { authorization } : {}\n\n\t\tconst pkg = await getPackageJson(pkgName)\n\t\tconst {\n\t\t\tdist: { tarball },\n\t\t} = pkg\n\n\t\tconst tmpDir = await this.fs.createTempDir()\n\t\tawait downloadTarball({ url: tarball, gotOpts: { headers }, dir: tmpDir })\n\t\tconst dirContent = await this.fs.readDir(tmpDir)\n\t\tif (dirContent.length !== 1 || dirContent[0] !== 'package') {\n\t\t\tthrow 'Invalid NPM package'\n\t\t}\n\t\treturn join(tmpDir, 'package')\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;AAOO,MAAM,kBAAkB;AAAA,EAE9B,YACkB,IAChB;AADgB,SAAA,KAAA;AAIlB,kBAAA,MAAA,mBAAkB,OAAO,YAAqC;AAC7D,YAAM,EAAE,MAAA,IAAU,IAAI,OAAO;AAC7B,YAAM,EAAE,cAAA,IAAkB,gBAAgB,KAAK;AAC/C,YAAM,UAAU,gBAAgB,EAAE,cAAA,IAAkB,CAAA;AAE9C,YAAA,MAAM,MAAM,eAAe,OAAO;AAClC,YAAA;AAAA,QACL,MAAM,EAAE,QAAQ;AAAA,MACb,IAAA;AAEJ,YAAM,SAAS,MAAM,KAAK,GAAG,cAAc;AACrC,YAAA,gBAAgB,EAAE,KAAK,SAAS,SAAS,EAAE,WAAW,KAAK,OAAA,CAAQ;AACzE,YAAM,aAAa,MAAM,KAAK,GAAG,QAAQ,MAAM;AAC/C,UAAI,WAAW,WAAW,KAAK,WAAW,CAAC,MAAM,WAAW;AACrD,cAAA;AAAA,MACP;AACO,aAAA,KAAK,QAAQ,SAAS;AAAA,IAAA,CAC9B;AAAA,EAnBA;AAoBD;"}
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const npa = require("npm-package-arg");
4
- const getRegistryInfo = require("registry-info");
5
- const getPackageJson = require("get-package-json-from-registry");
6
- const node_path = require("node:path");
7
- const downloadTarball = require("download-tarball");
8
- var __defProp = Object.defineProperty;
9
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
- var __publicField = (obj, key, value) => __defNormalProp(obj, key + "", value);
11
- class PackageDownloader {
12
- constructor(fs) {
13
- this.fs = fs;
14
- __publicField(this, "downloadPackage", async (pkgName) => {
15
- const { scope } = npa(pkgName);
16
- const { authorization } = getRegistryInfo(scope);
17
- const headers = authorization ? { authorization } : {};
18
- const pkg = await getPackageJson(pkgName);
19
- const {
20
- dist: { tarball }
21
- } = pkg;
22
- const tmpDir = await this.fs.createTempDir();
23
- await downloadTarball({ url: tarball, gotOpts: { headers }, dir: tmpDir });
24
- const dirContent = await this.fs.readDir(tmpDir);
25
- if (dirContent.length !== 1 || dirContent[0] !== "package") {
26
- throw "Invalid NPM package";
27
- }
28
- return node_path.join(tmpDir, "package");
29
- });
30
- }
31
- }
32
- exports.PackageDownloader = PackageDownloader;
33
- //# sourceMappingURL=PackageDownloader.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PackageDownloader.cjs","sources":["../../../../../packages/create/src/lib/PackageDownloader.ts"],"sourcesContent":["import npa from 'npm-package-arg'\nimport getRegistryInfo from 'registry-info'\nimport getPackageJson from 'get-package-json-from-registry'\nimport { join } from 'node:path'\nimport downloadTarball from 'download-tarball'\nimport { FileSystem } from './FileSystem'\n\nexport class PackageDownloader {\n\n\tconstructor(\n\t\tprivate readonly fs: FileSystem,\n\t) {\n\t}\n\n\tdownloadPackage = async (pkgName: string): Promise<string> => {\n\t\tconst { scope } = npa(pkgName)\n\t\tconst { authorization } = getRegistryInfo(scope)\n\t\tconst headers = authorization ? { authorization } : {}\n\n\t\tconst pkg = await getPackageJson(pkgName)\n\t\tconst {\n\t\t\tdist: { tarball },\n\t\t} = pkg\n\n\t\tconst tmpDir = await this.fs.createTempDir()\n\t\tawait downloadTarball({ url: tarball, gotOpts: { headers }, dir: tmpDir })\n\t\tconst dirContent = await this.fs.readDir(tmpDir)\n\t\tif (dirContent.length !== 1 || dirContent[0] !== 'package') {\n\t\t\tthrow 'Invalid NPM package'\n\t\t}\n\t\treturn join(tmpDir, 'package')\n\t}\n}\n"],"names":["join"],"mappings":";;;;;;;;;;AAOO,MAAM,kBAAkB;AAAA,EAE9B,YACkB,IAChB;AADgB,SAAA,KAAA;AAIlB,kBAAA,MAAA,mBAAkB,OAAO,YAAqC;AAC7D,YAAM,EAAE,MAAA,IAAU,IAAI,OAAO;AAC7B,YAAM,EAAE,cAAA,IAAkB,gBAAgB,KAAK;AAC/C,YAAM,UAAU,gBAAgB,EAAE,cAAA,IAAkB,CAAA;AAE9C,YAAA,MAAM,MAAM,eAAe,OAAO;AAClC,YAAA;AAAA,QACL,MAAM,EAAE,QAAQ;AAAA,MACb,IAAA;AAEJ,YAAM,SAAS,MAAM,KAAK,GAAG,cAAc;AACrC,YAAA,gBAAgB,EAAE,KAAK,SAAS,SAAS,EAAE,WAAW,KAAK,OAAA,CAAQ;AACzE,YAAM,aAAa,MAAM,KAAK,GAAG,QAAQ,MAAM;AAC/C,UAAI,WAAW,WAAW,KAAK,WAAW,CAAC,MAAM,WAAW;AACrD,cAAA;AAAA,MACP;AACO,aAAAA,UAAA,KAAK,QAAQ,SAAS;AAAA,IAAA,CAC9B;AAAA,EAnBA;AAoBD;;"}
@@ -1,33 +0,0 @@
1
- import npa from "npm-package-arg";
2
- import getRegistryInfo from "registry-info";
3
- import getPackageJson from "get-package-json-from-registry";
4
- import { join } from "node:path";
5
- import downloadTarball from "download-tarball";
6
- var __defProp = Object.defineProperty;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __publicField = (obj, key, value) => __defNormalProp(obj, key + "", value);
9
- class PackageDownloader {
10
- constructor(fs) {
11
- this.fs = fs;
12
- __publicField(this, "downloadPackage", async (pkgName) => {
13
- const { scope } = npa(pkgName);
14
- const { authorization } = getRegistryInfo(scope);
15
- const headers = authorization ? { authorization } : {};
16
- const pkg = await getPackageJson(pkgName);
17
- const {
18
- dist: { tarball }
19
- } = pkg;
20
- const tmpDir = await this.fs.createTempDir();
21
- await downloadTarball({ url: tarball, gotOpts: { headers }, dir: tmpDir });
22
- const dirContent = await this.fs.readDir(tmpDir);
23
- if (dirContent.length !== 1 || dirContent[0] !== "package") {
24
- throw "Invalid NPM package";
25
- }
26
- return join(tmpDir, "package");
27
- });
28
- }
29
- }
30
- export {
31
- PackageDownloader
32
- };
33
- //# sourceMappingURL=PackageDownloader.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PackageDownloader.js","sources":["../../../../../packages/create/src/lib/PackageDownloader.ts"],"sourcesContent":["import npa from 'npm-package-arg'\nimport getRegistryInfo from 'registry-info'\nimport getPackageJson from 'get-package-json-from-registry'\nimport { join } from 'node:path'\nimport downloadTarball from 'download-tarball'\nimport { FileSystem } from './FileSystem'\n\nexport class PackageDownloader {\n\n\tconstructor(\n\t\tprivate readonly fs: FileSystem,\n\t) {\n\t}\n\n\tdownloadPackage = async (pkgName: string): Promise<string> => {\n\t\tconst { scope } = npa(pkgName)\n\t\tconst { authorization } = getRegistryInfo(scope)\n\t\tconst headers = authorization ? { authorization } : {}\n\n\t\tconst pkg = await getPackageJson(pkgName)\n\t\tconst {\n\t\t\tdist: { tarball },\n\t\t} = pkg\n\n\t\tconst tmpDir = await this.fs.createTempDir()\n\t\tawait downloadTarball({ url: tarball, gotOpts: { headers }, dir: tmpDir })\n\t\tconst dirContent = await this.fs.readDir(tmpDir)\n\t\tif (dirContent.length !== 1 || dirContent[0] !== 'package') {\n\t\t\tthrow 'Invalid NPM package'\n\t\t}\n\t\treturn join(tmpDir, 'package')\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;AAOO,MAAM,kBAAkB;AAAA,EAE9B,YACkB,IAChB;AADgB,SAAA,KAAA;AAIlB,kBAAA,MAAA,mBAAkB,OAAO,YAAqC;AAC7D,YAAM,EAAE,MAAA,IAAU,IAAI,OAAO;AAC7B,YAAM,EAAE,cAAA,IAAkB,gBAAgB,KAAK;AAC/C,YAAM,UAAU,gBAAgB,EAAE,cAAA,IAAkB,CAAA;AAE9C,YAAA,MAAM,MAAM,eAAe,OAAO;AAClC,YAAA;AAAA,QACL,MAAM,EAAE,QAAQ;AAAA,MACb,IAAA;AAEJ,YAAM,SAAS,MAAM,KAAK,GAAG,cAAc;AACrC,YAAA,gBAAgB,EAAE,KAAK,SAAS,SAAS,EAAE,WAAW,KAAK,OAAA,CAAQ;AACzE,YAAM,aAAa,MAAM,KAAK,GAAG,QAAQ,MAAM;AAC/C,UAAI,WAAW,WAAW,KAAK,WAAW,CAAC,MAAM,WAAW;AACrD,cAAA;AAAA,MACP;AACO,aAAA,KAAK,QAAQ,SAAS;AAAA,IAAA,CAC9B;AAAA,EAnBA;AAoBD;"}
@@ -1,7 +0,0 @@
1
- import { FileSystem } from './FileSystem';
2
- export declare class PackageDownloader {
3
- private readonly fs;
4
- constructor(fs: FileSystem);
5
- downloadPackage: (pkgName: string) => Promise<string>;
6
- }
7
- //# sourceMappingURL=PackageDownloader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PackageDownloader.d.ts","sourceRoot":"","sources":["../../../src/lib/PackageDownloader.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,qBAAa,iBAAiB;IAG5B,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,UAAU;IAIhC,eAAe,YAAmB,MAAM,KAAG,OAAO,CAAC,MAAM,CAAC,CAiBzD;CACD"}
@@ -1,3 +0,0 @@
1
- VITE_CONTEMBER_ADMIN_API_BASE_URL=/_api
2
- VITE_CONTEMBER_ADMIN_SESSION_TOKEN=__SESSION_TOKEN__
3
- VITE_CONTEMBER_ADMIN_LOGIN_TOKEN=__LOGIN_TOKEN__
@@ -1,48 +0,0 @@
1
- import * as React from 'react'
2
- import { MouseEventHandler } from 'react'
3
- import { ChevronLeftIcon, ChevronRightIcon } from 'lucide-react'
4
- import { DataViewChangePageTrigger, useDataViewPagingInfo } from '@contember/react-dataview'
5
- import { Button } from '../ui/button'
6
- import { dict } from '../dict'
7
-
8
- export const SelectPagination = () => {
9
- const scrollToTop: MouseEventHandler = e => {
10
- const el = (e.target as HTMLElement).closest('[data-radix-scroll-area-viewport]')
11
- if (el) {
12
- requestAnimationFrame(() => {
13
- el.scrollTo({ top: 0, behavior: 'smooth' })
14
- })
15
- }
16
- }
17
- const pageInfo = useDataViewPagingInfo()
18
- if ((pageInfo.pagesCount ?? 1) <= 1) {
19
- return null
20
- }
21
-
22
- return (
23
- <div className="flex gap-6 lg:gap-8 justify-center items-center">
24
- <div className={'flex gap-1'}>
25
- <DataViewChangePageTrigger page="previous">
26
- <Button
27
- size={'xs'}
28
- variant="outline"
29
- onClick={scrollToTop}
30
- >
31
- <span className="sr-only">{dict.select.paginationPreviousPage}</span>
32
- <ChevronLeftIcon className="h-3 w-3"/>
33
- </Button>
34
- </DataViewChangePageTrigger>
35
- <DataViewChangePageTrigger page="next">
36
- <Button
37
- size={'xs'}
38
- variant="outline"
39
- onClick={scrollToTop}
40
- >
41
- <span className="sr-only">{dict.select.paginationNextPage}</span>
42
- <ChevronRightIcon className="h-3 w-3"/>
43
- </Button>
44
- </DataViewChangePageTrigger>
45
- </div>
46
- </div>
47
- )
48
- }
@@ -1,33 +0,0 @@
1
- import npa from 'npm-package-arg'
2
- import getRegistryInfo from 'registry-info'
3
- import getPackageJson from 'get-package-json-from-registry'
4
- import { join } from 'node:path'
5
- import downloadTarball from 'download-tarball'
6
- import { FileSystem } from './FileSystem'
7
-
8
- export class PackageDownloader {
9
-
10
- constructor(
11
- private readonly fs: FileSystem,
12
- ) {
13
- }
14
-
15
- downloadPackage = async (pkgName: string): Promise<string> => {
16
- const { scope } = npa(pkgName)
17
- const { authorization } = getRegistryInfo(scope)
18
- const headers = authorization ? { authorization } : {}
19
-
20
- const pkg = await getPackageJson(pkgName)
21
- const {
22
- dist: { tarball },
23
- } = pkg
24
-
25
- const tmpDir = await this.fs.createTempDir()
26
- await downloadTarball({ url: tarball, gotOpts: { headers }, dir: tmpDir })
27
- const dirContent = await this.fs.readDir(tmpDir)
28
- if (dirContent.length !== 1 || dirContent[0] !== 'package') {
29
- throw 'Invalid NPM package'
30
- }
31
- return join(tmpDir, 'package')
32
- }
33
- }
@@ -1,7 +0,0 @@
1
- declare module 'download-tarball' {
2
- export default function downloadTarball(args: {
3
- url: string
4
- dir: string
5
- gotOpts?: { headers?: Record<string, any> }
6
- }): Promise<void>
7
- }
@@ -1,3 +0,0 @@
1
- declare module 'get-package-json-from-registry' {
2
- export default function getPackageJson(packageName: string): any
3
- }
@@ -1,7 +0,0 @@
1
- declare module 'registry-info' {
2
- export default function getRegistryInfo(scope: string | null): {
3
- registryUrl: string
4
- authToken: string
5
- authorization: string
6
- }
7
- }