@builder.io/sdk-qwik 0.0.30 → 0.0.31

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.
@@ -1000,8 +1000,8 @@ const Image = /*#__PURE__*/ qwik.componentQrl(qwik.inlinedQrl((props)=>{
1000
1000
  props.aspectRatio && !(props.builderBlock?.children?.length && props.fitContent) ? /*#__PURE__*/ jsxRuntime.jsx("div", {
1001
1001
  class: "builder-image-sizer div-Image",
1002
1002
  style: {
1003
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
1004
- paddingTop: props.aspectRatio * 100 + "%"
1003
+ paddingTop: // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
1004
+ props.aspectRatio * 100 + "%"
1005
1005
  }
1006
1006
  }) : null,
1007
1007
  props.builderBlock?.children?.length && props.fitContent ? /*#__PURE__*/ jsxRuntime.jsx(qwik.Slot, {}) : null,
@@ -2544,7 +2544,7 @@ const getCssFromFont = function getCssFromFont(props, state, font) {
2544
2544
  if (font.files) for(const weight in font.files){
2545
2545
  const isNumber = String(Number(weight)) === weight;
2546
2546
  if (!isNumber) continue;
2547
- // TODO: maybe limit number loaded
2547
+ // TODO: maybe limit number loaded
2548
2548
  const weightUrl = font.files[weight];
2549
2549
  if (weightUrl && weightUrl !== url) str += `
2550
2550
  @font-face {
@@ -2610,6 +2610,7 @@ const contextContext = function contextContext(props, state, elementRef) {
2610
2610
  const allRegisteredComponents = function allRegisteredComponents(props, state, elementRef) {
2611
2611
  const allComponentsArray = [
2612
2612
  ...getDefaultRegisteredComponents(),
2613
+ // While this `components` object is deprecated, we must maintain support for it.
2613
2614
  // Since users are able to override our default components, we need to make sure that we do not break such
2614
2615
  // existing usage.
2615
2616
  // This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
@@ -2756,7 +2757,8 @@ const RenderContent = /*#__PURE__*/ qwik.componentQrl(qwik.inlinedQrl((props)=>{
2756
2757
  apiKey: props.apiKey,
2757
2758
  variationId: variationId !== contentId ? variationId : undefined
2758
2759
  });
2759
- } // override normal content in preview mode
2760
+ }
2761
+ // override normal content in preview mode
2760
2762
  if (isPreviewing()) {
2761
2763
  const searchParams = new URL(location.href).searchParams;
2762
2764
  if (props.model && searchParams.get("builder.preview") === props.model) {
@@ -996,8 +996,8 @@ const Image = /*#__PURE__*/ componentQrl(inlinedQrl((props)=>{
996
996
  props.aspectRatio && !(props.builderBlock?.children?.length && props.fitContent) ? /*#__PURE__*/ jsx("div", {
997
997
  class: "builder-image-sizer div-Image",
998
998
  style: {
999
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
1000
- paddingTop: props.aspectRatio * 100 + "%"
999
+ paddingTop: // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
1000
+ props.aspectRatio * 100 + "%"
1001
1001
  }
1002
1002
  }) : null,
1003
1003
  props.builderBlock?.children?.length && props.fitContent ? /*#__PURE__*/ jsx(Slot, {}) : null,
@@ -2540,7 +2540,7 @@ const getCssFromFont = function getCssFromFont(props, state, font) {
2540
2540
  if (font.files) for(const weight in font.files){
2541
2541
  const isNumber = String(Number(weight)) === weight;
2542
2542
  if (!isNumber) continue;
2543
- // TODO: maybe limit number loaded
2543
+ // TODO: maybe limit number loaded
2544
2544
  const weightUrl = font.files[weight];
2545
2545
  if (weightUrl && weightUrl !== url) str += `
2546
2546
  @font-face {
@@ -2606,6 +2606,7 @@ const contextContext = function contextContext(props, state, elementRef) {
2606
2606
  const allRegisteredComponents = function allRegisteredComponents(props, state, elementRef) {
2607
2607
  const allComponentsArray = [
2608
2608
  ...getDefaultRegisteredComponents(),
2609
+ // While this `components` object is deprecated, we must maintain support for it.
2609
2610
  // Since users are able to override our default components, we need to make sure that we do not break such
2610
2611
  // existing usage.
2611
2612
  // This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
@@ -2752,7 +2753,8 @@ const RenderContent = /*#__PURE__*/ componentQrl(inlinedQrl((props)=>{
2752
2753
  apiKey: props.apiKey,
2753
2754
  variationId: variationId !== contentId ? variationId : undefined
2754
2755
  });
2755
- } // override normal content in preview mode
2756
+ }
2757
+ // override normal content in preview mode
2756
2758
  if (isPreviewing()) {
2757
2759
  const searchParams = new URL(location.href).searchParams;
2758
2760
  if (props.model && searchParams.get("builder.preview") === props.model) {
package/package.json CHANGED
@@ -1,18 +1,12 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-qwik",
3
- "version": "0.0.30",
3
+ "version": "0.0.31",
4
4
  "description": "Builder.io Qwik SDK",
5
5
  "type": "module",
6
6
  "main": "./lib/index.qwik.cjs",
7
7
  "module": "./lib/index.qwik.mjs",
8
8
  "qwik": "./lib/index.qwik.mjs",
9
9
  "types": "./types/index.d.ts",
10
- "files": [
11
- "lib",
12
- "types",
13
- "README.md",
14
- "package.json"
15
- ],
16
10
  "exports": {
17
11
  ".": {
18
12
  "import": "./lib/index.qwik.mjs",
@@ -1,2 +1,6 @@
1
+ import type { BuilderContextInterface } from '../context/types.js';
1
2
  import type { BuilderBlock } from '../types/builder-block.js';
2
- export declare function getBlockStyles(block: BuilderBlock): Partial<CSSStyleDeclaration>;
3
+ export declare function getBlockStyles({ block, context, }: {
4
+ block: BuilderBlock;
5
+ context: BuilderContextInterface;
6
+ }): Partial<CSSStyleDeclaration>;
@@ -0,0 +1,13 @@
1
+ type Dictionary<T> = Record<string, T>;
2
+ type BuilderContent = any;
3
+ type BuilderBlock = any;
4
+ type RegisteredComponent = any;
5
+ type RegisteredComponents = any;
6
+ declare const builder: { env: 'dev'; apiKey: string };
7
+ // TODO(misko): HACKS to be removed
8
+ declare const get: (obj: any, key: string) => any;
9
+ declare const set: (obj: any, key: string, value: any) => void;
10
+ interface CSSProperties {
11
+ flexDirection: any;
12
+ }
13
+ declare const BuilderBlocks: (props: any) => any;
@@ -1,267 +0,0 @@
1
- export declare const avatarService: any;
2
- export declare const Avatar: import("@builder.io/qwik").Component<any>;
3
- export default Avatar;
4
- export declare const COMPONENT: {
5
- "@type": string;
6
- children: {
7
- "@type": string;
8
- bindings: {
9
- when: {
10
- code: string;
11
- };
12
- };
13
- children: ({
14
- "@type": string;
15
- bindings: {
16
- class?: undefined;
17
- title?: undefined;
18
- };
19
- children: never[];
20
- meta: {};
21
- name: string;
22
- properties: {
23
- _text: string;
24
- };
25
- scope: {};
26
- } | {
27
- "@type": string;
28
- bindings: {
29
- class: {
30
- code: string;
31
- };
32
- title: {
33
- code: string;
34
- };
35
- };
36
- children: ({
37
- "@type": string;
38
- bindings: {
39
- when?: undefined;
40
- };
41
- children: never[];
42
- meta: {};
43
- name: string;
44
- properties: {
45
- _text: string;
46
- };
47
- scope: {};
48
- } | {
49
- "@type": string;
50
- bindings: {
51
- when: {
52
- code: string;
53
- };
54
- };
55
- children: ({
56
- "@type": string;
57
- bindings: {
58
- class?: undefined;
59
- style?: undefined;
60
- };
61
- children: never[];
62
- meta: {};
63
- name: string;
64
- properties: {
65
- _text: string;
66
- };
67
- scope: {};
68
- } | {
69
- "@type": string;
70
- bindings: {
71
- class: {
72
- code: string;
73
- };
74
- style: {
75
- code: string;
76
- };
77
- };
78
- children: ({
79
- "@type": string;
80
- bindings: {
81
- when?: undefined;
82
- };
83
- children: never[];
84
- meta: {};
85
- name: string;
86
- properties: {
87
- _text: string;
88
- };
89
- scope: {};
90
- } | {
91
- "@type": string;
92
- bindings: {
93
- when: {
94
- code: string;
95
- };
96
- };
97
- children: ({
98
- "@type": string;
99
- bindings: {
100
- alt?: undefined;
101
- src?: undefined;
102
- };
103
- children: never[];
104
- meta: {};
105
- name: string;
106
- properties: {
107
- _text: string;
108
- class?: undefined;
109
- };
110
- scope: {};
111
- } | {
112
- "@type": string;
113
- bindings: {
114
- alt: {
115
- code: string;
116
- };
117
- src: {
118
- code: string;
119
- };
120
- };
121
- children: never[];
122
- meta: {};
123
- name: string;
124
- properties: {
125
- class: string;
126
- _text?: undefined;
127
- };
128
- scope: {};
129
- })[];
130
- meta: {};
131
- name: string;
132
- properties: {
133
- _text?: undefined;
134
- };
135
- scope: {};
136
- } | {
137
- "@type": string;
138
- bindings: {
139
- when: {
140
- code: string;
141
- };
142
- };
143
- children: ({
144
- "@type": string;
145
- bindings: {};
146
- children: never[];
147
- meta: {};
148
- name: string;
149
- properties: {
150
- _text: string;
151
- };
152
- scope: {};
153
- } | {
154
- "@type": string;
155
- bindings: {};
156
- children: {
157
- "@type": string;
158
- bindings: {
159
- _text: {
160
- code: string;
161
- };
162
- };
163
- children: never[];
164
- meta: {};
165
- name: string;
166
- properties: {};
167
- scope: {};
168
- }[];
169
- meta: {};
170
- name: string;
171
- properties: {
172
- _text?: undefined;
173
- };
174
- scope: {};
175
- })[];
176
- meta: {};
177
- name: string;
178
- properties: {
179
- _text?: undefined;
180
- };
181
- scope: {};
182
- })[];
183
- meta: {};
184
- name: string;
185
- properties: {
186
- _text?: undefined;
187
- };
188
- scope: {};
189
- })[];
190
- meta: {};
191
- name: string;
192
- properties: {
193
- _text?: undefined;
194
- };
195
- scope: {};
196
- })[];
197
- meta: {};
198
- name: string;
199
- properties: {
200
- _text?: undefined;
201
- };
202
- scope: {};
203
- })[];
204
- meta: {};
205
- name: string;
206
- properties: {};
207
- scope: {};
208
- }[];
209
- context: {
210
- get: {};
211
- set: {};
212
- };
213
- exports: {
214
- avatarService: {
215
- code: string;
216
- isFunction: boolean;
217
- usedInLocal: boolean;
218
- };
219
- };
220
- hooks: {
221
- onMount: {
222
- code: string;
223
- };
224
- };
225
- imports: {
226
- imports: {};
227
- path: string;
228
- }[];
229
- inputs: never[];
230
- meta: {
231
- useMetadata: {
232
- isAttachedToShadowDom: boolean;
233
- };
234
- };
235
- name: string;
236
- propsTypeRef: string;
237
- refs: {};
238
- state: {
239
- classes: {
240
- code: {
241
- base: string;
242
- container: string;
243
- };
244
- type: string;
245
- };
246
- initials: {
247
- code: null;
248
- type: string;
249
- };
250
- loaded: {
251
- code: boolean;
252
- type: string;
253
- };
254
- source: {
255
- code: null;
256
- type: string;
257
- };
258
- styles: {
259
- code: {
260
- container: null;
261
- };
262
- type: string;
263
- };
264
- };
265
- subComponents: never[];
266
- types: string[];
267
- };
@@ -1,19 +0,0 @@
1
- import { BaseProps, BaseState, CSS, Dynamic, Variant } from '~/models';
2
- export declare type AvatarProps = {
3
- variant?: Dynamic<Variant>;
4
- name?: string;
5
- unavatar?: string;
6
- url?: string;
7
- disabled?: boolean;
8
- } & BaseProps;
9
- export declare type AvatarState = {
10
- classes: {
11
- base: string;
12
- container: string;
13
- };
14
- styles: {
15
- container: CSS;
16
- };
17
- initials: string;
18
- source: string;
19
- } & BaseState;