@linktr.ee/linkapp 0.0.10 → 0.0.11
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.
- package/dev-server/classic/main.tsx +45 -24
- package/dev-server/classic.html +58 -0
- package/dev-server/featured/main.tsx +45 -24
- package/dev-server/featured.html +58 -0
- package/dev-server/preview/Preview.tsx +425 -14
- package/dist/cli.js +9 -3
- package/dist/cli.js.map +1 -1
- package/dist/commands/add.js +3 -3
- package/dist/commands/add.js.map +1 -1
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +10 -4
- package/dist/commands/deploy.js.map +1 -1
- package/dist/components/ThemeStyle.d.ts +30 -0
- package/dist/components/ThemeStyle.d.ts.map +1 -0
- package/dist/components/ThemeStyle.js +33 -0
- package/dist/components/ThemeStyle.js.map +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -0
- package/dist/lib/build/detect-layouts.d.ts.map +1 -1
- package/dist/lib/build/detect-layouts.js +1 -4
- package/dist/lib/build/detect-layouts.js.map +1 -1
- package/dist/lib/deploy/generate-manifest-files.d.ts.map +1 -1
- package/dist/lib/deploy/generate-manifest-files.js +6 -0
- package/dist/lib/deploy/generate-manifest-files.js.map +1 -1
- package/dist/lib/deploy/pack-project.d.ts.map +1 -1
- package/dist/lib/deploy/pack-project.js +32 -5
- package/dist/lib/deploy/pack-project.js.map +1 -1
- package/dist/lib/deploy/upload.d.ts +1 -0
- package/dist/lib/deploy/upload.d.ts.map +1 -1
- package/dist/lib/deploy/upload.js +12 -2
- package/dist/lib/deploy/upload.js.map +1 -1
- package/dist/lib/deploy/validation.d.ts.map +1 -1
- package/dist/lib/deploy/validation.js +4 -61
- package/dist/lib/deploy/validation.js.map +1 -1
- package/dist/lib/utils/setup-runtime.d.ts.map +1 -1
- package/dist/lib/utils/setup-runtime.js +48 -17
- package/dist/lib/utils/setup-runtime.js.map +1 -1
- package/dist/schema/config.schema.d.ts +50 -114
- package/dist/schema/config.schema.d.ts.map +1 -1
- package/dist/schema/config.schema.js +94 -18
- package/dist/schema/config.schema.js.map +1 -1
- package/dist/sdk/index.d.ts +21 -0
- package/dist/sdk/index.d.ts.map +1 -0
- package/dist/sdk/index.js +21 -0
- package/dist/sdk/index.js.map +1 -0
- package/dist/sdk/send-message.d.ts +16 -0
- package/dist/sdk/send-message.d.ts.map +1 -0
- package/dist/sdk/send-message.js +34 -0
- package/dist/sdk/send-message.js.map +1 -0
- package/dist/sdk/use-open-popup.d.ts +23 -0
- package/dist/sdk/use-open-popup.d.ts.map +1 -0
- package/dist/sdk/use-open-popup.js +29 -0
- package/dist/sdk/use-open-popup.js.map +1 -0
- package/dist/types.d.ts +149 -31
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +37 -1
- package/dist/types.js.map +1 -1
- package/package.json +11 -3
- package/runtime/index.html +58 -0
package/dist/types.d.ts
CHANGED
|
@@ -2,17 +2,25 @@
|
|
|
2
2
|
* Type definitions for LinkApp
|
|
3
3
|
* Note: Uses snake_case for API-facing types to match API requirements
|
|
4
4
|
*/
|
|
5
|
-
export type Environment =
|
|
5
|
+
export type Environment = "production" | "qa";
|
|
6
6
|
/**
|
|
7
|
-
* Theme configuration
|
|
7
|
+
* Theme configuration passed to link app iframes via postMessage
|
|
8
8
|
*/
|
|
9
|
-
export interface
|
|
9
|
+
export interface LinkAppTheme {
|
|
10
|
+
cssVariables: Record<string, string>;
|
|
11
|
+
/** @deprecated Use cssVariables['--button-style-text'] instead */
|
|
10
12
|
textColor: string;
|
|
13
|
+
/** @deprecated Use cssVariables['--button-style-background'] instead */
|
|
11
14
|
backgroundColor: string;
|
|
15
|
+
/** @deprecated Use cssVariables['--button-style-inner-radius'] instead */
|
|
12
16
|
borderRadius: string;
|
|
17
|
+
/** @deprecated Use cssVariables['--button-style-border-color'] instead */
|
|
13
18
|
borderColor: string;
|
|
14
|
-
|
|
19
|
+
/** @deprecated Use cssVariables['--button-style-background-hover'] instead */
|
|
20
|
+
backgroundHover: string;
|
|
21
|
+
/** @deprecated Use cssVariables['--button-style-contrast-color'] instead */
|
|
15
22
|
contrastColor: string;
|
|
23
|
+
/** @deprecated Use cssVariables instead */
|
|
16
24
|
textHoverColor: string;
|
|
17
25
|
}
|
|
18
26
|
/**
|
|
@@ -33,21 +41,15 @@ export interface Position {
|
|
|
33
41
|
* Core Linktree context available to all LinkApps
|
|
34
42
|
*/
|
|
35
43
|
export interface LinktreeContext {
|
|
36
|
-
linkUrl
|
|
37
|
-
layout?:
|
|
38
|
-
theme
|
|
39
|
-
locale: string;
|
|
40
|
-
currency: string;
|
|
41
|
-
username: string;
|
|
42
|
-
viewport: Viewport;
|
|
43
|
-
position?: Position;
|
|
44
|
+
linkUrl?: string;
|
|
45
|
+
layout?: "stack" | "grid" | "carousel" | "featured";
|
|
46
|
+
theme?: LinkAppTheme;
|
|
44
47
|
}
|
|
45
48
|
/**
|
|
46
49
|
* Props available to layout components
|
|
47
50
|
* Extend with custom settings from your config
|
|
48
51
|
*/
|
|
49
52
|
export type AppProps<TSettings = Record<string, unknown>> = LinktreeContext & TSettings;
|
|
50
|
-
export type LinktreeTheme = Theme;
|
|
51
53
|
export interface LinkAppManifest {
|
|
52
54
|
name: string;
|
|
53
55
|
tagline: string;
|
|
@@ -60,7 +62,7 @@ export interface LinkAppManifest {
|
|
|
60
62
|
documentation?: string;
|
|
61
63
|
website?: string;
|
|
62
64
|
};
|
|
63
|
-
category:
|
|
65
|
+
category: "grow" | "sell" | "share" | "learn";
|
|
64
66
|
search_terms: string[];
|
|
65
67
|
author: {
|
|
66
68
|
name: string;
|
|
@@ -71,33 +73,115 @@ export interface LinkAppManifest {
|
|
|
71
73
|
};
|
|
72
74
|
};
|
|
73
75
|
}
|
|
76
|
+
export declare enum SettingsIcon {
|
|
77
|
+
file = "file",
|
|
78
|
+
settings = "settings",
|
|
79
|
+
text_and_media = "text_and_media",
|
|
80
|
+
question = "question"
|
|
81
|
+
}
|
|
82
|
+
export declare enum SettingsElementInput {
|
|
83
|
+
button = "button",
|
|
84
|
+
text = "text",
|
|
85
|
+
textarea = "textarea",
|
|
86
|
+
number = "number",
|
|
87
|
+
radio = "radio",
|
|
88
|
+
checkbox = "checkbox",
|
|
89
|
+
select = "select",
|
|
90
|
+
password = "password",
|
|
91
|
+
switch = "switch",
|
|
92
|
+
linkBehavior = "linkBehavior",
|
|
93
|
+
file = "file",
|
|
94
|
+
url = "url",
|
|
95
|
+
integration = "integration",
|
|
96
|
+
embedOption = "embedOption",
|
|
97
|
+
array = "array"
|
|
98
|
+
}
|
|
99
|
+
export declare enum IntegrationCapability {
|
|
100
|
+
MANAGE_EMAIL_SUBSCRIBERS = "MANAGE_EMAIL_SUBSCRIBERS"
|
|
101
|
+
}
|
|
102
|
+
export declare enum InteractionEvent {
|
|
103
|
+
click = "click"
|
|
104
|
+
}
|
|
105
|
+
export declare enum ActionType {
|
|
106
|
+
"update-link" = "update-link"
|
|
107
|
+
}
|
|
108
|
+
export interface SettingsElementAction {
|
|
109
|
+
on: InteractionEvent;
|
|
110
|
+
type: ActionType;
|
|
111
|
+
data: {
|
|
112
|
+
link_type: string;
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
export interface SettingsElementValidation {
|
|
116
|
+
required?: boolean;
|
|
117
|
+
pattern?: string;
|
|
118
|
+
minLength?: number;
|
|
119
|
+
maxLength?: number;
|
|
120
|
+
min?: number;
|
|
121
|
+
max?: number;
|
|
122
|
+
maxSize?: number;
|
|
123
|
+
}
|
|
124
|
+
export interface SettingsOverview {
|
|
125
|
+
title?: string;
|
|
126
|
+
description: string;
|
|
127
|
+
}
|
|
128
|
+
export interface SetupInstructions {
|
|
129
|
+
title?: string;
|
|
130
|
+
description: string;
|
|
131
|
+
}
|
|
132
|
+
export interface SettingsElementOption {
|
|
133
|
+
value: string;
|
|
134
|
+
label: string;
|
|
135
|
+
}
|
|
136
|
+
export interface SettingsElementLinkBehaviorLabel {
|
|
137
|
+
linkOffLabel: string;
|
|
138
|
+
embedLabel: string;
|
|
139
|
+
}
|
|
140
|
+
export interface ConditionalDisplay {
|
|
141
|
+
dependsOn: string;
|
|
142
|
+
value: string | boolean;
|
|
143
|
+
operator?: "equals" | "notEquals" | "contains";
|
|
144
|
+
}
|
|
145
|
+
export interface ArrayOptions {
|
|
146
|
+
add_item_button_text?: string;
|
|
147
|
+
add_item_title?: string;
|
|
148
|
+
add_second_item_button_text?: string;
|
|
149
|
+
edit_item_title?: string;
|
|
150
|
+
item_format?: string;
|
|
151
|
+
min?: number;
|
|
152
|
+
max?: number;
|
|
153
|
+
}
|
|
74
154
|
export interface LinkAppSettings {
|
|
75
155
|
title: string;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
156
|
+
icon?: SettingsIcon;
|
|
157
|
+
uses_url?: boolean;
|
|
158
|
+
has_url?: boolean;
|
|
159
|
+
settings_tab_title?: string;
|
|
160
|
+
overview?: SettingsOverview;
|
|
161
|
+
setup_instructions?: SetupInstructions;
|
|
81
162
|
elements: SettingsElement[];
|
|
163
|
+
has_settings?: boolean;
|
|
82
164
|
supports_featured_layout?: boolean;
|
|
83
165
|
}
|
|
84
166
|
export interface SettingsElement {
|
|
85
167
|
id: string;
|
|
86
|
-
inputType:
|
|
87
|
-
title
|
|
168
|
+
inputType: SettingsElementInput;
|
|
169
|
+
title?: string;
|
|
88
170
|
description?: string;
|
|
89
|
-
defaultValue?:
|
|
171
|
+
defaultValue?: string | string[] | boolean;
|
|
90
172
|
label?: string;
|
|
91
173
|
placeholder?: string;
|
|
92
|
-
validation?:
|
|
93
|
-
options?:
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
174
|
+
validation?: SettingsElementValidation;
|
|
175
|
+
options?: SettingsElementOption[];
|
|
176
|
+
linkBehaviorLabels?: SettingsElementLinkBehaviorLabel;
|
|
177
|
+
accept?: string[];
|
|
178
|
+
multiple?: boolean;
|
|
179
|
+
action?: SettingsElementAction;
|
|
180
|
+
capability?: IntegrationCapability;
|
|
181
|
+
vendor?: string;
|
|
182
|
+
array_options?: ArrayOptions;
|
|
183
|
+
array_elements?: SettingsElement[];
|
|
184
|
+
conditionalDisplay?: ConditionalDisplay;
|
|
101
185
|
}
|
|
102
186
|
export interface UrlMatchRules {
|
|
103
187
|
hostnames: string[];
|
|
@@ -151,4 +235,38 @@ export interface ComponentRegistryItem {
|
|
|
151
235
|
export interface ComponentRegistry {
|
|
152
236
|
[key: string]: ComponentRegistryItem;
|
|
153
237
|
}
|
|
238
|
+
/**
|
|
239
|
+
* PostMessage communication between LinkApp iframe and parent
|
|
240
|
+
*/
|
|
241
|
+
/**
|
|
242
|
+
* Message sent to open a popup/modal in the parent window
|
|
243
|
+
* Parent identifies the LinkApp from event.source
|
|
244
|
+
*/
|
|
245
|
+
export interface OpenPopupMessage {
|
|
246
|
+
source: "linkapp";
|
|
247
|
+
type: "OPEN_POPUP";
|
|
248
|
+
payload: {
|
|
249
|
+
data?: Record<string, unknown>;
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Union of all messages sent FROM LinkApp iframe TO parent window
|
|
254
|
+
* Extensible for future message types (navigation, analytics, etc.)
|
|
255
|
+
*/
|
|
256
|
+
export type LinkAppMessage = OpenPopupMessage;
|
|
257
|
+
/**
|
|
258
|
+
* Message sent from parent window TO LinkApp iframe to update theme
|
|
259
|
+
* Uses CSS-native approach inspired by Figma's iframe theming
|
|
260
|
+
*/
|
|
261
|
+
export interface ThemeUpdateMessage {
|
|
262
|
+
type: "THEME_UPDATE";
|
|
263
|
+
payload: {
|
|
264
|
+
name: string;
|
|
265
|
+
variables: Record<string, string>;
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Union of all messages sent FROM parent window TO LinkApp iframe
|
|
270
|
+
*/
|
|
271
|
+
export type ParentToLinkAppMessage = ThemeUpdateMessage;
|
|
154
272
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,IAAI,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,YAAY;IAK3B,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAGrC,kEAAkE;IAClE,SAAS,EAAE,MAAM,CAAC;IAClB,wEAAwE;IACxE,eAAe,EAAE,MAAM,CAAC;IACxB,0EAA0E;IAC1E,YAAY,EAAE,MAAM,CAAC;IACrB,0EAA0E;IAC1E,WAAW,EAAE,MAAM,CAAC;IACpB,8EAA8E;IAC9E,eAAe,EAAE,MAAM,CAAC;IACxB,4EAA4E;IAC5E,aAAa,EAAE,MAAM,CAAC;IACtB,2CAA2C;IAC3C,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC;IACpD,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB;AAED;;;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AAqB,CAAC;CACtC;AAED;;GAEG;AAEH;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,SAAS,CAAC;IAClB,IAAI,EAAE,YAAY,CAAC;IACnB,OAAO,EAAE;QACP,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAChC,CAAC;CACH;AAED;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,gBAAgB,CAAC;AAE9C;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,cAAc,CAAC;IACrB,OAAO,EAAE;QAEP,IAAI,EAAE,MAAM,CAAC;QAEb,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACnC,CAAC;CACH;AAED;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,kBAAkB,CAAC"}
|
package/dist/types.js
CHANGED
|
@@ -2,5 +2,41 @@
|
|
|
2
2
|
* Type definitions for LinkApp
|
|
3
3
|
* Note: Uses snake_case for API-facing types to match API requirements
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export var SettingsIcon;
|
|
6
|
+
(function (SettingsIcon) {
|
|
7
|
+
SettingsIcon["file"] = "file";
|
|
8
|
+
SettingsIcon["settings"] = "settings";
|
|
9
|
+
SettingsIcon["text_and_media"] = "text_and_media";
|
|
10
|
+
SettingsIcon["question"] = "question";
|
|
11
|
+
})(SettingsIcon || (SettingsIcon = {}));
|
|
12
|
+
export var SettingsElementInput;
|
|
13
|
+
(function (SettingsElementInput) {
|
|
14
|
+
SettingsElementInput["button"] = "button";
|
|
15
|
+
SettingsElementInput["text"] = "text";
|
|
16
|
+
SettingsElementInput["textarea"] = "textarea";
|
|
17
|
+
SettingsElementInput["number"] = "number";
|
|
18
|
+
SettingsElementInput["radio"] = "radio";
|
|
19
|
+
SettingsElementInput["checkbox"] = "checkbox";
|
|
20
|
+
SettingsElementInput["select"] = "select";
|
|
21
|
+
SettingsElementInput["password"] = "password";
|
|
22
|
+
SettingsElementInput["switch"] = "switch";
|
|
23
|
+
SettingsElementInput["linkBehavior"] = "linkBehavior";
|
|
24
|
+
SettingsElementInput["file"] = "file";
|
|
25
|
+
SettingsElementInput["url"] = "url";
|
|
26
|
+
SettingsElementInput["integration"] = "integration";
|
|
27
|
+
SettingsElementInput["embedOption"] = "embedOption";
|
|
28
|
+
SettingsElementInput["array"] = "array";
|
|
29
|
+
})(SettingsElementInput || (SettingsElementInput = {}));
|
|
30
|
+
export var IntegrationCapability;
|
|
31
|
+
(function (IntegrationCapability) {
|
|
32
|
+
IntegrationCapability["MANAGE_EMAIL_SUBSCRIBERS"] = "MANAGE_EMAIL_SUBSCRIBERS";
|
|
33
|
+
})(IntegrationCapability || (IntegrationCapability = {}));
|
|
34
|
+
export var InteractionEvent;
|
|
35
|
+
(function (InteractionEvent) {
|
|
36
|
+
InteractionEvent["click"] = "click";
|
|
37
|
+
})(InteractionEvent || (InteractionEvent = {}));
|
|
38
|
+
export var ActionType;
|
|
39
|
+
(function (ActionType) {
|
|
40
|
+
ActionType["update-link"] = "update-link";
|
|
41
|
+
})(ActionType || (ActionType = {}));
|
|
6
42
|
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAuFH,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,qCAAqB,CAAA;IACrB,iDAAiC,CAAA;IACjC,qCAAqB,CAAA;AACvB,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB;AAED,MAAM,CAAN,IAAY,oBAgBX;AAhBD,WAAY,oBAAoB;IAC9B,yCAAiB,CAAA;IACjB,qCAAa,CAAA;IACb,6CAAqB,CAAA;IACrB,yCAAiB,CAAA;IACjB,uCAAe,CAAA;IACf,6CAAqB,CAAA;IACrB,yCAAiB,CAAA;IACjB,6CAAqB,CAAA;IACrB,yCAAiB,CAAA;IACjB,qDAA6B,CAAA;IAC7B,qCAAa,CAAA;IACb,mCAAW,CAAA;IACX,mDAA2B,CAAA;IAC3B,mDAA2B,CAAA;IAC3B,uCAAe,CAAA;AACjB,CAAC,EAhBW,oBAAoB,KAApB,oBAAoB,QAgB/B;AAED,MAAM,CAAN,IAAY,qBAEX;AAFD,WAAY,qBAAqB;IAC/B,8EAAqD,CAAA;AACvD,CAAC,EAFW,qBAAqB,KAArB,qBAAqB,QAEhC;AAED,MAAM,CAAN,IAAY,gBAEX;AAFD,WAAY,gBAAgB;IAC1B,mCAAe,CAAA;AACjB,CAAC,EAFW,gBAAgB,KAAhB,gBAAgB,QAE3B;AAED,MAAM,CAAN,IAAY,UAEX;AAFD,WAAY,UAAU;IACpB,yCAA6B,CAAA;AAC/B,CAAC,EAFW,UAAU,KAAV,UAAU,QAErB"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linktr.ee/linkapp",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"description": "Development, build, and deployment tooling for LinkApps",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
|
-
"linkapp": "
|
|
8
|
-
"create-linktree-link-run": "
|
|
7
|
+
"linkapp": "bin/cli.js",
|
|
8
|
+
"create-linktree-link-run": "bin/cli.js"
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"dist",
|
|
@@ -21,6 +21,14 @@
|
|
|
21
21
|
},
|
|
22
22
|
"./types": {
|
|
23
23
|
"types": "./dist/types.d.ts"
|
|
24
|
+
},
|
|
25
|
+
"./components": {
|
|
26
|
+
"types": "./dist/components/index.d.ts",
|
|
27
|
+
"import": "./dist/components/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./sdk": {
|
|
30
|
+
"types": "./dist/sdk/index.d.ts",
|
|
31
|
+
"import": "./dist/sdk/index.js"
|
|
24
32
|
}
|
|
25
33
|
},
|
|
26
34
|
"scripts": {
|
package/runtime/index.html
CHANGED
|
@@ -4,6 +4,64 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>LinkApp</title>
|
|
7
|
+
|
|
8
|
+
<!-- Linktree theme variables will be injected here -->
|
|
9
|
+
<style id="linktree-theme"></style>
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
/**
|
|
13
|
+
* Helper function to convert CSS variables object to CSS string
|
|
14
|
+
* @param {Record<string, string>} vars - Object with CSS variable names as keys
|
|
15
|
+
* @returns {string} CSS string like "--var1: value1; --var2: value2;"
|
|
16
|
+
*/
|
|
17
|
+
function renderCssVariables(vars) {
|
|
18
|
+
return Object.entries(vars)
|
|
19
|
+
.map((entry) => entry.join(': '))
|
|
20
|
+
.join('; ') + ';'
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Listen for theme updates from parent window
|
|
25
|
+
* Applies CSS variables to the document root
|
|
26
|
+
*/
|
|
27
|
+
window.addEventListener('message', function(event) {
|
|
28
|
+
// Only process messages with the correct structure
|
|
29
|
+
if (
|
|
30
|
+
event.data &&
|
|
31
|
+
typeof event.data === 'object' &&
|
|
32
|
+
event.data.type === 'THEME_UPDATE'
|
|
33
|
+
) {
|
|
34
|
+
const themeUpdate = event.data
|
|
35
|
+
|
|
36
|
+
// Get the style element where theme variables are injected
|
|
37
|
+
const themeStyle = document.getElementById('linktree-theme')
|
|
38
|
+
|
|
39
|
+
if (!themeStyle) {
|
|
40
|
+
console.warn('linktree-theme style element not found')
|
|
41
|
+
return
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Inject CSS variables into :root
|
|
45
|
+
themeStyle.textContent = ':root { ' + renderCssVariables(themeUpdate.payload.variables) + ' }'
|
|
46
|
+
|
|
47
|
+
// Remove any existing theme classes
|
|
48
|
+
const classesToRemove = []
|
|
49
|
+
document.documentElement.classList.forEach((className) => {
|
|
50
|
+
if (className.startsWith('linktree-theme-')) {
|
|
51
|
+
classesToRemove.push(className)
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
classesToRemove.forEach((className) => {
|
|
55
|
+
document.documentElement.classList.remove(className)
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
// Add theme class for additional styling hooks
|
|
59
|
+
if (themeUpdate.payload.name && themeUpdate.payload.name !== 'legacy') {
|
|
60
|
+
document.documentElement.classList.add('linktree-theme-' + themeUpdate.payload.name)
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}, false)
|
|
64
|
+
</script>
|
|
7
65
|
</head>
|
|
8
66
|
<body>
|
|
9
67
|
<div id="root"></div>
|