@bagelink/blox 1.5.15 → 1.5.20

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 (107) hide show
  1. package/README.md +105 -1
  2. package/dist/blox.css +720 -68
  3. package/dist/components/base/Button.vue.d.ts.map +1 -1
  4. package/dist/components/base/Container.vue.d.ts.map +1 -1
  5. package/dist/components/base/Image.vue.d.ts.map +1 -1
  6. package/dist/components/base/Spacer.vue.d.ts.map +1 -1
  7. package/dist/components/base/Text.vue.d.ts.map +1 -1
  8. package/dist/components/base/Title.vue.d.ts.map +1 -1
  9. package/dist/components/blocks/BigImage.vue.d.ts +12 -0
  10. package/dist/components/blocks/BigImage.vue.d.ts.map +1 -0
  11. package/dist/components/blocks/BigQuote.vue.d.ts +14 -0
  12. package/dist/components/blocks/BigQuote.vue.d.ts.map +1 -0
  13. package/dist/components/blocks/BlockFooter.vue.d.ts +17 -0
  14. package/dist/components/blocks/BlockFooter.vue.d.ts.map +1 -0
  15. package/dist/components/blocks/BlockNav.vue.d.ts +22 -0
  16. package/dist/components/blocks/BlockNav.vue.d.ts.map +1 -0
  17. package/dist/components/blocks/Cards.vue.d.ts +18 -0
  18. package/dist/components/blocks/Cards.vue.d.ts.map +1 -0
  19. package/dist/components/blocks/Contact.vue.d.ts +22 -0
  20. package/dist/components/blocks/Contact.vue.d.ts.map +1 -0
  21. package/dist/components/blocks/CountDown.vue.d.ts +76 -0
  22. package/dist/components/blocks/CountDown.vue.d.ts.map +1 -0
  23. package/dist/components/blocks/Cta.vue.d.ts +15 -0
  24. package/dist/components/blocks/Cta.vue.d.ts.map +1 -0
  25. package/dist/components/blocks/Faq.vue.d.ts +20 -0
  26. package/dist/components/blocks/Faq.vue.d.ts.map +1 -0
  27. package/dist/components/blocks/Grid.vue.d.ts +24 -0
  28. package/dist/components/blocks/Grid.vue.d.ts.map +1 -0
  29. package/dist/components/blocks/Icons.vue.d.ts +16 -0
  30. package/dist/components/blocks/Icons.vue.d.ts.map +1 -0
  31. package/dist/components/blocks/IconsList.vue.d.ts +22 -0
  32. package/dist/components/blocks/IconsList.vue.d.ts.map +1 -0
  33. package/dist/components/blocks/ImageCarousel.vue.d.ts +16 -0
  34. package/dist/components/blocks/ImageCarousel.vue.d.ts.map +1 -0
  35. package/dist/components/blocks/ImageLinkBoxes.vue.d.ts +14 -0
  36. package/dist/components/blocks/ImageLinkBoxes.vue.d.ts.map +1 -0
  37. package/dist/components/blocks/Logos.vue.d.ts +17 -0
  38. package/dist/components/blocks/Logos.vue.d.ts.map +1 -0
  39. package/dist/components/blocks/PopUp.vue.d.ts +23 -0
  40. package/dist/components/blocks/PopUp.vue.d.ts.map +1 -0
  41. package/dist/components/blocks/PriceTable.vue.d.ts +24 -0
  42. package/dist/components/blocks/PriceTable.vue.d.ts.map +1 -0
  43. package/dist/components/blocks/Space.vue.d.ts +25 -0
  44. package/dist/components/blocks/Space.vue.d.ts.map +1 -0
  45. package/dist/components/blocks/Tabs.vue.d.ts +15 -0
  46. package/dist/components/blocks/Tabs.vue.d.ts.map +1 -0
  47. package/dist/components/blocks/Team.vue.d.ts +19 -0
  48. package/dist/components/blocks/Team.vue.d.ts.map +1 -0
  49. package/dist/components/blocks/Testimonials.vue.d.ts +18 -0
  50. package/dist/components/blocks/Testimonials.vue.d.ts.map +1 -0
  51. package/dist/components/blocks/Text.vue.d.ts +10 -0
  52. package/dist/components/blocks/Text.vue.d.ts.map +1 -0
  53. package/dist/components/blocks/TextImage.vue.d.ts +20 -0
  54. package/dist/components/blocks/TextImage.vue.d.ts.map +1 -0
  55. package/dist/components/blocks/TextSide.vue.d.ts +19 -0
  56. package/dist/components/blocks/TextSide.vue.d.ts.map +1 -0
  57. package/dist/components/blocks/Title.vue.d.ts +16 -0
  58. package/dist/components/blocks/Title.vue.d.ts.map +1 -0
  59. package/dist/components/blocks/TitleSide.vue.d.ts +21 -0
  60. package/dist/components/blocks/TitleSide.vue.d.ts.map +1 -0
  61. package/dist/components/blocks/VideoBox.vue.d.ts +15 -0
  62. package/dist/components/blocks/VideoBox.vue.d.ts.map +1 -0
  63. package/dist/components/blocks/blocks.d.ts +27 -0
  64. package/dist/components/blocks/blocks.d.ts.map +1 -0
  65. package/dist/components/index.d.ts +4 -3
  66. package/dist/components/index.d.ts.map +1 -1
  67. package/dist/config/baseComponents.d.ts +12 -2
  68. package/dist/config/baseComponents.d.ts.map +1 -1
  69. package/dist/config/blockComponents.d.ts +41 -0
  70. package/dist/config/blockComponents.d.ts.map +1 -0
  71. package/dist/core/communication.d.ts.map +1 -1
  72. package/dist/core/registry.d.ts.map +1 -1
  73. package/dist/core/renderer.d.ts.map +1 -1
  74. package/dist/core/types.d.ts.map +1 -1
  75. package/dist/index.cjs +9420 -480
  76. package/dist/index.d.ts +4 -1
  77. package/dist/index.d.ts.map +1 -1
  78. package/dist/index.mjs +9325 -478
  79. package/dist/setup.d.ts +114 -6
  80. package/dist/setup.d.ts.map +1 -1
  81. package/dist/utils/componentPreviewGenerator.d.ts +113 -0
  82. package/dist/utils/componentPreviewGenerator.d.ts.map +1 -0
  83. package/dist/utils/normalizer.d.ts.map +1 -1
  84. package/dist/utils/styles.d.ts.map +1 -1
  85. package/dist/views/ExternalPreview.vue.d.ts.map +1 -1
  86. package/dist/views/RenderPage.vue.d.ts.map +1 -1
  87. package/package.json +5 -2
  88. package/components/base/Button.vue +0 -140
  89. package/components/base/Container.vue +0 -64
  90. package/components/base/Image.vue +0 -75
  91. package/components/base/Spacer.vue +0 -33
  92. package/components/base/Text.vue +0 -37
  93. package/components/base/Title.vue +0 -55
  94. package/components/index.ts +0 -20
  95. package/config/baseComponents.ts +0 -342
  96. package/core/communication.ts +0 -140
  97. package/core/registry.ts +0 -108
  98. package/core/renderer.ts +0 -217
  99. package/core/types.ts +0 -148
  100. package/dist/vite.config.d.ts +0 -3
  101. package/dist/vite.config.d.ts.map +0 -1
  102. package/index.ts +0 -33
  103. package/setup.ts +0 -56
  104. package/utils/normalizer.ts +0 -74
  105. package/utils/styles.ts +0 -228
  106. package/views/ExternalPreview.vue +0 -420
  107. package/views/RenderPage.vue +0 -127
package/dist/setup.d.ts CHANGED
@@ -1,24 +1,132 @@
1
+ import { App } from 'vue';
2
+ import { Router } from 'vue-router';
1
3
  import { ComponentConfig } from './config/baseComponents';
4
+ export interface BloxInstance {
5
+ /**
6
+ * Register one or more components with the Blox library
7
+ * Accepts either a single component config or an array of component configs
8
+ */
9
+ registerComponents: (components: ComponentConfig | ComponentConfig[], options?: RegisterOptions) => BloxInstance;
10
+ /**
11
+ * Register routes for preview pages with your Vue Router
12
+ */
13
+ registerRoutes: (router: Router, options?: RouteOptions) => BloxInstance;
14
+ /**
15
+ * Get all registered component configurations
16
+ */
17
+ getRegisteredComponents: () => ComponentConfig[];
18
+ /**
19
+ * Get components by category
20
+ */
21
+ getComponentsByCategory: (category: string) => ComponentConfig[];
22
+ /**
23
+ * Get a list of registered component IDs
24
+ */
25
+ getComponentIds: () => string[];
26
+ /**
27
+ * Check if a component is registered
28
+ */
29
+ hasComponent: (id: string) => boolean;
30
+ /**
31
+ * Install the Blox plugin into your Vue app
32
+ */
33
+ install: (app: App) => void;
34
+ }
35
+ export interface RegisterOptions {
36
+ /**
37
+ * Category to assign to the components
38
+ */
39
+ category?: string;
40
+ /**
41
+ * Skip validation for component configs
42
+ * @default false
43
+ */
44
+ skipValidation?: boolean;
45
+ }
46
+ export interface RouteOptions {
47
+ /**
48
+ * Base path for the preview routes
49
+ * @default '/blox'
50
+ */
51
+ basePath?: string;
52
+ /**
53
+ * Path for the external preview route
54
+ * @default '/preview/:pageId?'
55
+ */
56
+ previewPath?: string;
57
+ /**
58
+ * Path for the render page route
59
+ * @default '/render/:pageId?'
60
+ */
61
+ renderPath?: string;
62
+ /**
63
+ * Additional route meta properties
64
+ */
65
+ meta?: Record<string, any>;
66
+ }
67
+ export interface BloxOptions {
68
+ /**
69
+ * Enable debug mode for additional logging
70
+ * @default false
71
+ */
72
+ debug?: boolean;
73
+ /**
74
+ * Automatically register default blox (built-in components)
75
+ * @default false
76
+ */
77
+ useDefaultBlox?: boolean;
78
+ }
2
79
  /**
3
- * Register all base components from the library
4
- * Call this in your project's setup to make base components available
80
+ * Validation error class
5
81
  */
6
- export declare function registerBaseComponents(): void;
82
+ export declare class ComponentValidationError extends Error {
83
+ componentId?: string | undefined;
84
+ constructor(message: string, componentId?: string | undefined);
85
+ }
86
+ /**
87
+ * Create a new Blox instance with a fluent API
88
+ *
89
+ * @param options - Configuration options for the Blox instance
90
+ *
91
+ * @example
92
+ * ```ts
93
+ * import { createBlox, ButtonConfig, TextConfig } from '@bagelink/blox'
94
+ * import { MyCustomComp } from './components'
95
+ *
96
+ * const blox = createBlox({ debug: true })
97
+ * blox.registerComponents([ButtonConfig, TextConfig, MyCustomComp])
98
+ * blox.registerRoutes(router)
99
+ *
100
+ * app.use(blox)
101
+ * ```
102
+ */
103
+ export declare function createBlox(options?: BloxOptions): BloxInstance;
7
104
  /**
8
- * Get all component configurations (base + custom)
105
+ * Helper to create a custom component configuration with better TypeScript inference
106
+ */
107
+ export declare function createComponentConfig<T extends ComponentConfig>(config: T): T;
108
+ /**
109
+ * Get all component configurations (base + blocks + custom)
9
110
  * This returns both the Vue components and their editor schemas
10
111
  */
11
112
  export declare function getAllComponentConfigs(customConfigs?: ComponentConfig[]): ComponentConfig[];
12
113
  /**
13
- * Helper to create a custom component configuration
114
+ * Register all base components from the library
115
+ * Call this in your project's setup to make base components available
116
+ *
117
+ * @deprecated Use `createBlox().registerComponents()` instead for a simpler API
14
118
  */
15
- export declare function createComponentConfig(config: ComponentConfig): ComponentConfig;
119
+ export declare function registerBaseComponents(): void;
16
120
  /**
17
121
  * Register a single custom component
122
+ *
123
+ * @deprecated Use `createBlox().registerComponents()` instead for a simpler API
18
124
  */
19
125
  export declare function registerCustomComponent(config: ComponentConfig): void;
20
126
  /**
21
127
  * Register multiple custom components
128
+ *
129
+ * @deprecated Use `createBlox().registerComponents()` instead for a simpler API
22
130
  */
23
131
  export declare function registerCustomComponents(configs: ComponentConfig[]): void;
24
132
  //# sourceMappingURL=setup.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../setup.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAwB,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAGpF;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAS7C;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,aAAa,GAAE,eAAe,EAAO,GAAG,eAAe,EAAE,CAE/F;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,eAAe,GAAG,eAAe,CAE9E;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAGrE;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,IAAI,CAIzE"}
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC9B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAwB,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAOpF,MAAM,WAAW,YAAY;IAC5B;;;OAGG;IACH,kBAAkB,EAAE,CACnB,UAAU,EAAE,eAAe,GAAG,eAAe,EAAE,EAC/C,OAAO,CAAC,EAAE,eAAe,KACrB,YAAY,CAAA;IAEjB;;OAEG;IACH,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,KAAK,YAAY,CAAA;IAExE;;OAEG;IACH,uBAAuB,EAAE,MAAM,eAAe,EAAE,CAAA;IAEhD;;OAEG;IACH,uBAAuB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAA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CAS7C;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAGrE;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,IAAI,CAIzE"}
@@ -0,0 +1,113 @@
1
+ /**
2
+ * Auto-generated SVG previews for components
3
+ * This file generates SVG-based previews for block components
4
+ */
5
+ interface BlockPreviewConfig {
6
+ background: string;
7
+ gradient?: {
8
+ from: string;
9
+ to: string;
10
+ direction?: 'horizontal' | 'vertical' | 'diagonal';
11
+ };
12
+ elements: Array<{
13
+ type: 'rect' | 'circle' | 'text' | 'line' | 'gradient';
14
+ x: number;
15
+ y: number;
16
+ width?: number;
17
+ height?: number;
18
+ radius?: number;
19
+ text?: string;
20
+ fill?: string;
21
+ stroke?: string;
22
+ strokeWidth?: number;
23
+ fontSize?: number;
24
+ fontWeight?: string;
25
+ opacity?: number;
26
+ shadow?: boolean;
27
+ rx?: number;
28
+ gradient?: {
29
+ from: string;
30
+ to: string;
31
+ direction?: 'horizontal' | 'vertical' | 'diagonal';
32
+ };
33
+ }>;
34
+ }
35
+ interface ComponentAnalysis {
36
+ id: string;
37
+ category?: string;
38
+ icon?: string;
39
+ label?: string;
40
+ hasText: boolean;
41
+ hasRichText?: boolean;
42
+ hasImage: boolean;
43
+ hasButton: boolean;
44
+ hasItems: boolean;
45
+ hasIcon: boolean;
46
+ hasVideo: boolean;
47
+ hasForm?: boolean;
48
+ isNav: boolean;
49
+ isFooter: boolean;
50
+ isHero: boolean;
51
+ isCard: boolean;
52
+ isGrid: boolean;
53
+ isList: boolean;
54
+ isModal: boolean;
55
+ isSlider: boolean;
56
+ isTabs: boolean;
57
+ isVideo: boolean;
58
+ isTestimonial: boolean;
59
+ isPricing: boolean;
60
+ isFullWidth: boolean;
61
+ isCentered: boolean;
62
+ hasColumns: boolean;
63
+ contentStructure?: any;
64
+ settingsStructure?: any;
65
+ defaultValues?: any;
66
+ propNames: string[];
67
+ }
68
+ /**
69
+ * Generate SVG preview for a component type
70
+ */
71
+ export declare function generateSVGPreview(componentId: string): string;
72
+ /**
73
+ * Get preview for a component (main function to use)
74
+ * 1. Uses registered preview config (manual) - highest priority
75
+ * 2. Uses enhanced analysis from component configs if available
76
+ * 3. Falls back to default preview
77
+ */
78
+ export declare function getComponentPreview(componentId: string, label?: string): string;
79
+ /**
80
+ * Get preview with auto-generation (opt-in)
81
+ * Use this if you want automatic preview generation from component analysis
82
+ */
83
+ export declare function getComponentPreviewAuto(componentId: string, label?: string, component?: any): string;
84
+ /**
85
+ * Register a custom preview configuration
86
+ */
87
+ export declare function registerPreviewConfig(componentId: string, config: BlockPreviewConfig): void;
88
+ /**
89
+ * Check if a component has a preview config
90
+ */
91
+ export declare function hasPreviewConfig(componentId: string): boolean;
92
+ /**
93
+ * Get all registered preview config IDs
94
+ */
95
+ export declare function getRegisteredPreviewIds(): string[];
96
+ /**
97
+ * Export types for use by consumers
98
+ */
99
+ export type { BlockPreviewConfig };
100
+ /**
101
+ * Development helper: Generate and log preview for testing
102
+ * This function is useful for debugging and testing new component previews
103
+ */
104
+ export declare function debugComponentPreview(componentId: string, label?: string): void;
105
+ /**
106
+ * Development helper: Get enhanced component analysis
107
+ */
108
+ export declare function debugComponentAnalysis(componentId: string): ComponentAnalysis | null;
109
+ /**
110
+ * Development helper: Test all component preview mappings
111
+ */
112
+ export declare function debugAllPreviews(): void;
113
+ //# sourceMappingURL=componentPreviewGenerator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"componentPreviewGenerator.d.ts","sourceRoot":"","sources":["../../src/utils/componentPreviewGenerator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,UAAU,kBAAkB;IAC3B,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE;QACV,IAAI,EAAE,MAAM,CAAA;QACZ,EAAE,EAAE,MAAM,CAAA;QACV,SAAS,CAAC,EAAE,YAAY,GAAG,UAAU,G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,qBAAqB,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAgB/E;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,GAAG,iBAAiB,GAAG,IAAI,CAQpF;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAoCvC"}
@@ -1 +1 @@
1
- {"version":3,"file":"normalizer.d.ts","sourceRoot":"","sources":["../../utils/normalizer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAwCrF;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAEtC;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,GAAG,GAAG,CAYvD"}
1
+ {"version":3,"file":"normalizer.d.ts","sourceRoot":"","sources":["../../src/utils/normalizer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAwCrF;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAEtC;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,GAAG,GAAG,CAYvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../utils/styles.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,mBAAmB,CAClC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACzB,QAAQ,GAAE,OAAe,GACvB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAqKxB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,EAAE,CAgBxE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CA8BzC"}
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/utils/styles.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,mBAAmB,CAClC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACzB,QAAQ,GAAE,OAAe,GACvB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAyKxB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,EAAE,CAgBxE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CA8BzC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ExternalPreview.vue.d.ts","sourceRoot":"","sources":["../../views/ExternalPreview.vue"],"names":[],"mappings":"AAAA,OA8aO,KAAK,EAAiB,QAAQ,EAAE,MAAM,eAAe,CAAA;AAQ5D,UAAU,KAAK;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,eAAe,CAAC,EAAE,QAAQ,CAAA;IAC1B,gBAAgB,CAAC,EAAE,GAAG,EAAE,CAAA;CACxB;;YAHS,MAAM;sBAEI,GAAG,EAAE;;AAoXzB,wBAQG"}
1
+ {"version":3,"file":"ExternalPreview.vue.d.ts","sourceRoot":"","sources":["../../src/views/ExternalPreview.vue"],"names":[],"mappings":"AA2oBA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAiB,QAAQ,EAAE,MAAM,eAAe,CAAA;AAQ5D,UAAU,KAAK;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,eAAe,CAAC,EAAE,QAAQ,CAAA;IAC1B,gBAAgB,CAAC,EAAE,GAAG,EAAE,CAAA;CACxB;;YAHS,MAAM;sBAEI,GAAG,EAAE;;AA2ZzB,wBAQG"}
@@ -1 +1 @@
1
- {"version":3,"file":"RenderPage.vue.d.ts","sourceRoot":"","sources":["../../views/RenderPage.vue"],"names":[],"mappings":"AAAA,OAwIO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAO7C,UAAU,KAAK;IACd,QAAQ,EAAE,QAAQ,CAAA;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAA;CACzB;;sBADmB,MAAM;;AAsI1B,wBAQG"}
1
+ {"version":3,"file":"RenderPage.vue.d.ts","sourceRoot":"","sources":["../../src/views/RenderPage.vue"],"names":[],"mappings":"AA8HA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAO7C,UAAU,KAAK;IACd,QAAQ,EAAE,QAAQ,CAAA;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAA;CACzB;;sBADmB,MAAM;;AAmI1B,wBAQG"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/blox",
3
3
  "type": "module",
4
- "version": "1.5.15",
4
+ "version": "1.5.20",
5
5
  "description": "Blox page builder library for drag-and-drop page building and static data management",
6
6
  "author": {
7
7
  "name": "Bagel Studio",
@@ -74,7 +74,9 @@
74
74
  "access": "public"
75
75
  },
76
76
  "peerDependencies": {
77
- "vue": "^3.3.0"
77
+ "vue": "^3.3.0",
78
+ "vue-router": "^4.0.0",
79
+ "@bagelink/vue": "1.5.20"
78
80
  },
79
81
  "devDependencies": {
80
82
  "@vitejs/plugin-vue": "^5.0.0",
@@ -84,6 +86,7 @@
84
86
  "vite-plugin-dts": "^4.0.0",
85
87
  "vite-tsconfig-paths": "^5.0.0",
86
88
  "vue": "^3.5.16",
89
+ "vue-router": "^4.6.3",
87
90
  "vue-tsc": "^2.0.0"
88
91
  },
89
92
  "scripts": {
@@ -1,140 +0,0 @@
1
- <script setup lang="ts">
2
- /**
3
- * Base Button Component
4
- *
5
- * A customizable button/link component
6
- */
7
-
8
- interface Props {
9
- btnTxt?: string
10
- btnUrl?: string
11
- btnTarget?: '_self' | '_blank' | '_parent' | '_top'
12
- variant?: 'primary' | 'secondary' | 'outline' | 'ghost'
13
- size?: 'sm' | 'md' | 'lg'
14
- align?: 'left' | 'center' | 'right'
15
- fullWidth?: boolean
16
- isMobile?: boolean
17
- }
18
-
19
- const props = withDefaults(defineProps<Props>(), {
20
- btnTxt: 'Click Me',
21
- btnUrl: '#',
22
- btnTarget: '_self',
23
- variant: 'primary',
24
- size: 'md',
25
- align: 'left',
26
- fullWidth: false,
27
- })
28
-
29
- function handleClick(e: MouseEvent) {
30
- // Emit event for analytics tracking if needed
31
- console.log('Button clicked:', props.btnTxt)
32
- }
33
- </script>
34
-
35
- <template>
36
- <div :class="`button-wrapper align-${align}`">
37
- <a
38
- :href="btnUrl"
39
- :target="btnTarget"
40
- :rel="btnTarget === '_blank' ? 'noopener noreferrer' : undefined"
41
- class="btn" :class="[
42
- `btn-${variant}`,
43
- `btn-${size}`,
44
- { 'btn-full-width': fullWidth },
45
- ]"
46
- @click="handleClick"
47
- >
48
- {{ btnTxt }}
49
- </a>
50
- </div>
51
- </template>
52
-
53
- <style scoped>
54
- .button-wrapper {
55
- display: flex;
56
- }
57
-
58
- .button-wrapper.align-left {
59
- justify-content: flex-start;
60
- }
61
-
62
- .button-wrapper.align-center {
63
- justify-content: center;
64
- }
65
-
66
- .button-wrapper.align-right {
67
- justify-content: flex-end;
68
- }
69
-
70
- .btn {
71
- display: inline-block;
72
- padding: 0.75rem 1.5rem;
73
- text-decoration: none;
74
- border-radius: 6px;
75
- font-weight: 500;
76
- transition: all 0.2s;
77
- cursor: pointer;
78
- border: 2px solid transparent;
79
- text-align: center;
80
- }
81
-
82
- .btn-full-width {
83
- width: 100%;
84
- }
85
-
86
- /* Sizes */
87
- .btn-sm {
88
- padding: 0.5rem 1rem;
89
- font-size: 0.875rem;
90
- }
91
-
92
- .btn-md {
93
- padding: 0.75rem 1.5rem;
94
- font-size: 1rem;
95
- }
96
-
97
- .btn-lg {
98
- padding: 1rem 2rem;
99
- font-size: 1.125rem;
100
- }
101
-
102
- /* Variants */
103
- .btn-primary {
104
- background: #3b82f6;
105
- color: white;
106
- }
107
-
108
- .btn-primary:hover {
109
- background: #2563eb;
110
- }
111
-
112
- .btn-secondary {
113
- background: #6b7280;
114
- color: white;
115
- }
116
-
117
- .btn-secondary:hover {
118
- background: #4b5563;
119
- }
120
-
121
- .btn-outline {
122
- background: transparent;
123
- border-color: #3b82f6;
124
- color: #3b82f6;
125
- }
126
-
127
- .btn-outline:hover {
128
- background: #3b82f6;
129
- color: white;
130
- }
131
-
132
- .btn-ghost {
133
- background: transparent;
134
- color: #3b82f6;
135
- }
136
-
137
- .btn-ghost:hover {
138
- background: rgba(59, 130, 246, 0.1);
139
- }
140
- </style>
@@ -1,64 +0,0 @@
1
- <script setup lang="ts">
2
- /**
3
- * Base Container Component
4
- *
5
- * A wrapper component for grouping other blocks
6
- */
7
-
8
- interface Props {
9
- maxWidth?: number | string
10
- padding?: number | string
11
- gap?: number // Gap between child elements in pixels
12
- layout?: 'vertical' | 'horizontal' | 'grid'
13
- columns?: number // For grid layout
14
- isMobile?: boolean
15
- }
16
-
17
- const props = withDefaults(defineProps<Props>(), {
18
- maxWidth: 1200,
19
- padding: 20,
20
- gap: 16,
21
- layout: 'vertical',
22
- columns: 3,
23
- })
24
-
25
- const containerStyle = {
26
- maxWidth: typeof props.maxWidth === 'number' ? `${props.maxWidth}px` : props.maxWidth,
27
- padding: typeof props.padding === 'number' ? `${props.padding}px` : props.padding,
28
- gap: `${props.gap}px`,
29
- }
30
- </script>
31
-
32
- <template>
33
- <div class="container" :class="[`layout-${layout}`]" :style="containerStyle">
34
- <slot />
35
- </div>
36
- </template>
37
-
38
- <style scoped>
39
- .container {
40
- margin: 0 auto;
41
- }
42
-
43
- .layout-vertical {
44
- display: flex;
45
- flex-direction: column;
46
- }
47
-
48
- .layout-horizontal {
49
- display: flex;
50
- flex-direction: row;
51
- flex-wrap: wrap;
52
- }
53
-
54
- .layout-grid {
55
- display: grid;
56
- grid-template-columns: repeat(v-bind(columns), 1fr);
57
- }
58
-
59
- @media (max-width: 768px) {
60
- .layout-grid {
61
- grid-template-columns: 1fr;
62
- }
63
- }
64
- </style>
@@ -1,75 +0,0 @@
1
- <script setup lang="ts">
2
- /**
3
- * Base Image Component
4
- *
5
- * Displays an image with optional link and captions
6
- */
7
-
8
- interface Props {
9
- src?: string
10
- alt?: string
11
- caption?: string
12
- link?: string
13
- linkTarget?: '_self' | '_blank' | '_parent' | '_top'
14
- objectFit?: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down'
15
- aspectRatio?: string // e.g., '16/9', '4/3', '1/1'
16
- isMobile?: boolean
17
- }
18
-
19
- const props = withDefaults(defineProps<Props>(), {
20
- src: '',
21
- alt: '',
22
- caption: '',
23
- link: '',
24
- linkTarget: '_self',
25
- objectFit: 'cover',
26
- aspectRatio: 'auto',
27
- })
28
-
29
- const imageStyle = {
30
- objectFit: props.objectFit,
31
- aspectRatio: props.aspectRatio,
32
- }
33
- </script>
34
-
35
- <template>
36
- <figure class="image-wrapper">
37
- <a
38
- v-if="link"
39
- :href="link"
40
- :target="linkTarget"
41
- :rel="linkTarget === '_blank' ? 'noopener noreferrer' : undefined"
42
- class="image-link"
43
- >
44
- <img :src="src" :alt="alt" :style="imageStyle" class="image">
45
- </a>
46
- <img v-else :src="src" :alt="alt" :style="imageStyle" class="image">
47
- <figcaption v-if="caption" class="image-caption">
48
- {{ caption }}
49
- </figcaption>
50
- </figure>
51
- </template>
52
-
53
- <style scoped>
54
- .image-wrapper {
55
- margin: 0;
56
- padding: 0;
57
- }
58
-
59
- .image-link {
60
- display: block;
61
- }
62
-
63
- .image {
64
- width: 100%;
65
- height: auto;
66
- display: block;
67
- }
68
-
69
- .image-caption {
70
- margin-top: 0.5rem;
71
- font-size: 0.875rem;
72
- color: #6b7280;
73
- text-align: center;
74
- }
75
- </style>
@@ -1,33 +0,0 @@
1
- <script setup lang="ts">
2
- /**
3
- * Base Spacer Component
4
- *
5
- * Creates vertical spacing between blocks
6
- */
7
-
8
- interface Props {
9
- height?: number | string // Height in pixels or 'auto'
10
- heightMobile?: number | string
11
- isMobile?: boolean
12
- }
13
-
14
- const props = withDefaults(defineProps<Props>(), {
15
- height: 40,
16
- heightMobile: undefined,
17
- })
18
-
19
- function computedHeight() {
20
- const h = props.isMobile && props.heightMobile ? props.heightMobile : props.height
21
- return typeof h === 'number' ? `${h}px` : h
22
- }
23
- </script>
24
-
25
- <template>
26
- <div class="spacer" :style="{ height: computedHeight() }" />
27
- </template>
28
-
29
- <style scoped>
30
- .spacer {
31
- width: 100%;
32
- }
33
- </style>
@@ -1,37 +0,0 @@
1
- <script setup lang="ts">
2
- /**
3
- * Base Text Component
4
- *
5
- * A simple text/paragraph component for displaying rich content
6
- */
7
-
8
- interface Props {
9
- content?: string
10
- tag?: 'p' | 'div' | 'span' | 'article' | 'section'
11
- align?: 'left' | 'center' | 'right' | 'justify'
12
- }
13
-
14
- const { content = '', tag = 'div', align = 'left' } = defineProps<Props>()
15
- </script>
16
-
17
- <template>
18
- <component :is="tag" :class="`text-align-${align}`" v-html="content" />
19
- </template>
20
-
21
- <style scoped>
22
- .text-align-left {
23
- text-align: left;
24
- }
25
-
26
- .text-align-center {
27
- text-align: center;
28
- }
29
-
30
- .text-align-right {
31
- text-align: right;
32
- }
33
-
34
- .text-align-justify {
35
- text-align: justify;
36
- }
37
- </style>