@blocklet/pages-kit-runtime 0.1.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 (51) hide show
  1. package/LICENSE +13 -0
  2. package/lib/cjs/block-studio/build-lib.js +95 -0
  3. package/lib/cjs/block-studio/generate-wrapper-code.js +123 -0
  4. package/lib/cjs/block-studio/init-resource-router.js +166 -0
  5. package/lib/cjs/block-studio/plugins/_theme.js +7 -0
  6. package/lib/cjs/block-studio/plugins/index.js +19 -0
  7. package/lib/cjs/block-studio/plugins/vite-plugin-block-studio.js +176 -0
  8. package/lib/cjs/block-studio/plugins/vite-plugin-html-transform.js +245 -0
  9. package/lib/cjs/block-studio/plugins/vite-plugin-remote-script-localizer.js +211 -0
  10. package/lib/cjs/block-studio/utils.js +53 -0
  11. package/lib/cjs/client.js +24 -0
  12. package/lib/cjs/components/create-resource.js +32 -0
  13. package/lib/cjs/components/index.js +17 -0
  14. package/lib/cjs/index.js +2 -0
  15. package/lib/cjs/tsconfig.tsbuildinfo +1 -0
  16. package/lib/cjs/types/index.js +5 -0
  17. package/lib/cjs/utils/index.js +1 -0
  18. package/lib/esm/block-studio/build-lib.js +89 -0
  19. package/lib/esm/block-studio/generate-wrapper-code.js +87 -0
  20. package/lib/esm/block-studio/init-resource-router.js +124 -0
  21. package/lib/esm/block-studio/plugins/_theme.js +4 -0
  22. package/lib/esm/block-studio/plugins/index.js +3 -0
  23. package/lib/esm/block-studio/plugins/vite-plugin-block-studio.js +140 -0
  24. package/lib/esm/block-studio/plugins/vite-plugin-html-transform.js +241 -0
  25. package/lib/esm/block-studio/plugins/vite-plugin-remote-script-localizer.js +175 -0
  26. package/lib/esm/block-studio/utils.js +43 -0
  27. package/lib/esm/client.js +17 -0
  28. package/lib/esm/components/create-resource.js +29 -0
  29. package/lib/esm/components/index.js +1 -0
  30. package/lib/esm/index.js +1 -0
  31. package/lib/esm/tsconfig.tsbuildinfo +1 -0
  32. package/lib/esm/types/index.js +2 -0
  33. package/lib/esm/utils/index.js +1 -0
  34. package/lib/types/block-studio/build-lib.d.ts +3 -0
  35. package/lib/types/block-studio/generate-wrapper-code.d.ts +5 -0
  36. package/lib/types/block-studio/init-resource-router.d.ts +5 -0
  37. package/lib/types/block-studio/plugins/_theme.d.ts +1 -0
  38. package/lib/types/block-studio/plugins/index.d.ts +3 -0
  39. package/lib/types/block-studio/plugins/vite-plugin-block-studio.d.ts +6 -0
  40. package/lib/types/block-studio/plugins/vite-plugin-html-transform.d.ts +5 -0
  41. package/lib/types/block-studio/plugins/vite-plugin-remote-script-localizer.d.ts +8 -0
  42. package/lib/types/block-studio/utils.d.ts +14 -0
  43. package/lib/types/client.d.ts +11 -0
  44. package/lib/types/components/create-resource.d.ts +7 -0
  45. package/lib/types/components/index.d.ts +1 -0
  46. package/lib/types/index.d.ts +1 -0
  47. package/lib/types/tsconfig.tsbuildinfo +1 -0
  48. package/lib/types/types/index.d.ts +39 -0
  49. package/lib/types/utils/index.d.ts +0 -0
  50. package/package.json +169 -0
  51. package/tsconfig.json +13 -0
@@ -0,0 +1,2 @@
1
+ export const STATE_MODES = ['production', 'draft'];
2
+ export const PUBLISH_MODES = ['production'];
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,3 @@
1
+ export declare function buildLib(options: {
2
+ cwd?: string;
3
+ }): Promise<void>;
@@ -0,0 +1,5 @@
1
+ export declare function generateWrapperCode({ project, state }: any): Promise<{
2
+ fileName: string;
3
+ content: string;
4
+ }[]>;
5
+ export default generateWrapperCode;
@@ -0,0 +1,5 @@
1
+ export declare function copyFile(src: string, dest: string): Promise<void>;
2
+ export declare function copyDirectory(src: string, dest: string): Promise<void>;
3
+ export declare function copyRecursive(src: string, dest: string): Promise<void>;
4
+ export declare const initResourceRouter: import("express-ws").Router;
5
+ export default initResourceRouter;
@@ -0,0 +1 @@
1
+ export default function Theme(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export * from './vite-plugin-block-studio';
2
+ export * from './vite-plugin-html-transform';
3
+ export * from './vite-plugin-remote-script-localizer';
@@ -0,0 +1,6 @@
1
+ import type { Plugin } from 'vite';
2
+ export declare function initBlockStudioPlugins(options?: {
3
+ cwd?: string;
4
+ entryFilesPattern?: string;
5
+ }): Plugin[];
6
+ export default initBlockStudioPlugins;
@@ -0,0 +1,5 @@
1
+ import { Plugin } from 'vite';
2
+ export declare const VIRTUAL_MODULE_ID = "virtual:html-preview";
3
+ export declare const RESOLVED_VIRTUAL_MODULE_ID = "\0virtual:html-preview";
4
+ export declare function initHtmlPreviewTransformPlugin(): Plugin;
5
+ export default initHtmlPreviewTransformPlugin;
@@ -0,0 +1,8 @@
1
+ import { Plugin } from 'vite';
2
+ interface RemoteScriptLocalizerOptions {
3
+ tempDir?: string;
4
+ maxConcurrent?: number;
5
+ timeout?: number;
6
+ }
7
+ export declare function initRemoteScriptLocalizerPlugin(options?: RemoteScriptLocalizerOptions): Plugin;
8
+ export default initRemoteScriptLocalizerPlugin;
@@ -0,0 +1,14 @@
1
+ export interface GlobOptions {
2
+ cwd?: string;
3
+ filter?: string[];
4
+ }
5
+ export declare function setBlockEntryFilesPattern(pattern: string): void;
6
+ export declare function getBlockEntryFilesPattern(): string;
7
+ export declare function findComponentFiles(options?: GlobOptions): {
8
+ file: string;
9
+ blockName: string;
10
+ fullPath: string;
11
+ isHtml: boolean;
12
+ }[];
13
+ export declare function getBlockName(entry: string): string;
14
+ export declare const logger: Console;
@@ -0,0 +1,11 @@
1
+ interface ProjectRuntimeProps {
2
+ state: any;
3
+ projectId: string;
4
+ }
5
+ export declare class ProjectRuntime {
6
+ private state;
7
+ private projectId;
8
+ constructor({ state, projectId }: ProjectRuntimeProps);
9
+ render(container: HTMLElement): void;
10
+ }
11
+ export {};
@@ -0,0 +1,7 @@
1
+ export declare function CreateResource({ open, onClose, blockletDid, mode, }: {
2
+ open: boolean;
3
+ onClose: () => void;
4
+ blockletDid: string;
5
+ mode: 'dialog' | 'page';
6
+ }): import("react/jsx-runtime").JSX.Element | null;
7
+ export default CreateResource;
@@ -0,0 +1 @@
1
+ export * from './create-resource';
@@ -0,0 +1 @@
1
+ export {};