andesine 0.0.1-alpha.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Vrite, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,163 @@
1
+ # Vrite JavaScript SDK
2
+
3
+ [Vrite JavaScript SDK](https://github.com/vriteio/vrite/tree/main/packages/sdk) is a one-stop-shop when building any kind of Vrite-powered website or web app.
4
+
5
+ Currently it includes the following parts:
6
+
7
+ - **API client** — for easy access to Vrite API;
8
+ - **Content transformers** — functions used to transform Vrite JSON content into different formats;
9
+ - **Astro integration** — dedicated integration for [Astro](<%5Bhttps://astro.build/%5D(https://astro.build/)>);
10
+ - **Extensions SDK** - for building custom extensions for Vrite;
11
+
12
+ ## Installation
13
+
14
+ ```shell
15
+ npm i @vrite/sdk
16
+ ```
17
+
18
+ ## Usage
19
+
20
+ The Vrite SDK is modular, so you can import only the parts of it you need. On top of that, it's **isomorphic**, with both the API client and content transformers library being able to run both in the browser and Node.js.
21
+
22
+ ### API client
23
+
24
+ Start by initializing the API client, by importing the library, and providing your API access token:
25
+
26
+ ```javascript
27
+ import { createClient } from "@vrite/sdk/api";
28
+ const vrite = createClient({
29
+ token: "[YOUR_API_TOKEN]"
30
+ });
31
+ ```
32
+
33
+ With the client configured, you can access [all the endpoints of the Vrite API](https://generator.swagger.io/?url=https://api.vrite.io/swagger.json) via convenient JavaScript methods. Here are a few examples:
34
+
35
+ ```javascript
36
+ // Get all content groups
37
+ const contentGroups = await vrite.contentGroups.list();
38
+ // Get all content pieces from a content group
39
+ const contentPieces = await vrite.contentPieces.list({
40
+ contentGroupId: "[CONTENT_GROUP_ID]"
41
+ });
42
+ // Get the entire conten piece with JSON content
43
+ const contentPiece = await vrite.contentPieces.get({
44
+ id: "[CONTENT_PIECE_ID]",
45
+ content: true
46
+ });
47
+ ```
48
+
49
+ To explore available endpoints, check out [Vrite API docs](https://generator.swagger.io/?url=https://api.vrite.io/swagger.json). On top of that, the API client is **fully typed** (written in TypeScript) so you can easily find your way using your modern code editor's autocomplete functionality.
50
+
51
+ ### Content transformers
52
+
53
+ **Content transformers** are functions dedicated to processing Vrite JSON output and adapting it to required string-based formats.
54
+
55
+ The JSON output, based on the [ProseMirror](https://prosemirror.net/) library powering the Vrite Editor, is very versatile and easy to process, making it the ideal choice, no matter how your content has to be delivered. Content transformers help with this process by further simplifying the processing of these recursive JSON trees to output strings.
56
+
57
+ ```javascript
58
+ import { createContentTransformer, gfmTransformer, htmlTransformer } from "@vrite/sdk/transformers";
59
+
60
+ const sampleVriteJSON = {
61
+ // ...
62
+ };
63
+ // Transforms JSON to GitHub Flavored Markdown format
64
+ const gfmOutput = gfmTransformer(sampleVriteJSON);
65
+ // Transforms JSON to HTML format
66
+ const htmlOutput = htmlTransformer(sampleVriteJSON);
67
+ // Create your own content transformers
68
+ const customContentTransformer = createContentTransformer({
69
+ applyInlineFormatting(type, attrs, content) {
70
+ switch (type) {
71
+ case "link":
72
+ return `<a href="${attrs.href}">${content}</a>`;
73
+ case "bold":
74
+ return `<strong>${content}</strong>`;
75
+ case "code":
76
+ return `<code>${content}</code>`;
77
+ case "italic":
78
+ return `<em>${content}</em>`;
79
+ default:
80
+ return content;
81
+ }
82
+ },
83
+ transformNode(type, attrs, content) {
84
+ switch (type) {
85
+ case "paragraph":
86
+ return `<p>${content}</p>`;
87
+ case "heading":
88
+ return `<h${attrs?.level || 1}>${content}</h${attrs?.level || 1}>`;
89
+ case "blockquote":
90
+ return `<blockquote>${content}</blockquote>`;
91
+ case "bulletList":
92
+ return `<ul>${content}</ul>`;
93
+ case "orderedList":
94
+ return `<ol>${content}</ol>`;
95
+ case "listItem":
96
+ return `<li>${content}</li>`;
97
+ case "horizontalRule":
98
+ return `<hr/>`;
99
+ default:
100
+ return content;
101
+ }
102
+ }
103
+ });
104
+ ```
105
+
106
+ The SDK provides built-in content transformers for both HTML and GFM formats.
107
+
108
+ ### Astro integration
109
+
110
+ Vrite Astro integration makes integrating Vrite with your Astro-powered website really easy!
111
+
112
+ Start by adding the Vrite plugin into the Astro config:
113
+
114
+ ```javascript
115
+ import { defineConfig } from "astro/config";
116
+ import { vritePlugin } from "@vrite/sdk/astro";
117
+ export default defineConfig({
118
+ integrations: [
119
+ // ...
120
+ vritePlugin({
121
+ accessToken: "[YOUR_ACCESS_TOKEN]",
122
+ contentGroupId: "[CONTENT_GROUP_ID]"
123
+ })
124
+ // ...
125
+ ]
126
+ });
127
+ ```
128
+
129
+ In the configuration provide both your **API access token**, as well as the **ID of the content group** containing the posts for publishing on your Astro-powered website.
130
+
131
+ If you're using **TypeScript**, add the following to your _tsconfig.json_, under `compilerOptions.types`:
132
+
133
+ ```json
134
+ { "compilerOptions": { "types": ["@vrite/sdk/types"] } }
135
+ ```
136
+
137
+ Now you can import from a `virtual:vrite` module that provides configured API client, along with a few utils for integrating Vrite with Astro:
138
+
139
+ ```astro
140
+ ---
141
+ import { Content, client, getContentPieces, getStaticPaths } from "virtual:vrite";
142
+
143
+ // Pre-configured Vrite API client
144
+ const settings = await client.userSettings.get();
145
+ // Utility to retrieve content pieces from the configured content group
146
+ const contentPieces = await getContentPieces();
147
+ // Shortcut for retriving all content pieces for use with Astro SSG
148
+ export getStaticPaths;
149
+ ---
150
+
151
+ <!-- Renders the Vrite content piece, specified by ID or slug -->
152
+ <content contentPieceId="..." slug="..." />
153
+ ```
154
+
155
+ - `Content` — renders Vrite content piece specified either by ID (`contentPieceId` prop) or a slug (`slug` prop); Useful when in SSR mode;
156
+ - `client` — pre-configured Vrite API client for easy access;
157
+ - `getContentPieces` — retrieves content pieces from the content group specified in the config file. Accepts an object with the following properties:
158
+ - `limit?: number | "all" = 50` — how many content pieces to retrieve; `"all"` retrieves all of them, in batches of 50;
159
+ - `startPage?: number = 1` — if `limit` is a number and pagination is used, what page to start retrieving content pieces from?
160
+ - `tagId?: string` — Tag ID, if you want to filter results by specific tag.
161
+ - `getStaticPaths` — shortcut function for easy re-export when using Vrite SSG and inside _[slug].astro_ file. It returns `params.slug` as the content piece's slug and all basic content piece properties as `props`.
162
+
163
+ For a more detailed guide on using the Vrite Astro integration, [check out this blog post](https://vrite.io/blog/start-programming-blog-in-minutes-with-astro-and-vrite/).
package/dist/api.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";const w=require("@sanity/eventsource");function _interopDefaultCompat(c){return c&&typeof c=="object"&&"default"in c?c.default:c}const w__default=_interopDefaultCompat(w),n$4="/content-groups",r$3=c=>({get:p=>c("GET",`${n$4}`,{params:p}),list:p=>c("GET",`${n$4}/list`,{params:p}),create:p=>c("POST",`${n$4}`,{body:p}),update:p=>c("PUT",`${n$4}`,{body:p}),delete:p=>c("DELETE",`${n$4}`,{params:p})}),e$2="/content-pieces",a$3=c=>({get:p=>c("GET",`${e$2}`,{params:p}),create:p=>c("POST",`${e$2}`,{body:p}),update:p=>c("PUT",`${e$2}`,{body:p}),delete:p=>c("DELETE",`${e$2}`,{params:p}),list:({contentGroupId:p,...u})=>c("GET",`${e$2}/list`,{params:{...u,...p&&{contentGroupId:typeof p=="string"?p:p.join(",")}}})}),b=c=>{let p=c.baseURL||"https://api.vrite.io",u=c.extensionId||"",T=c.headers||{},G=null,{token:h}=c;return{sendRequest:async(d,$,m)=>{try{const{default:E}=await import("isomorphic-unfetch"),g=await E(`${p}${$}/?${encodeURI(Object.entries(m?.params||{}).filter(([,P])=>P).map(([P,k])=>`${P}=${k}`).join("&"))}`,{headers:{Authorization:`Bearer ${h}`,Accept:"application/json",...m?.body?{"Content-Type":"application/json"}:{},...u?{"X-Vrite-Extension-ID":u}:{},...T},body:m?.body?JSON.stringify(m.body):null,signal:G,method:d});G=null;let l=null;try{if(l=await g.json(),!l)return}catch{return}if(!g.ok)throw l;const f=g.headers.get("x-pagination-total");return f?Object.assign(l,{meta:{pagination:{total:parseInt(f),pages:parseInt(g.headers.get("x-pagination-pages")||"0"),perPage:parseInt(g.headers.get("x-pagination-per-page")||"0"),page:parseInt(g.headers.get("x-pagination-page")||"0")}}}):l}catch(E){throw console.error(E),E}},reconfigure:d=>{p=d.baseURL||p,h=d.token||h,u=d.extensionId||u,T=d.headers||T},useSignal:d=>{G=d},getConfig:()=>({baseURL:p,token:h,extensionId:u,headers:T}),getSignal:()=>G}},t$5="/user-settings",r$2=c=>({get:()=>c("GET",`${t$5}`),update:p=>c("PUT",`${t$5}`,{body:p})}),t$4="/tags",e$1=c=>({get:p=>c("GET",`${t$4}`,{params:p}),update:p=>c("PUT",`${t$4}`,{body:p}),create:p=>c("PUT",`${t$4}`,{body:p}),delete:p=>c("DELETE",`${t$4}`,{params:p}),list:p=>c("GET",`${t$4}/list`,{params:p})}),i$1="/profile",n$3=c=>({get:()=>c("GET",`${i$1}`)}),t$3="/webhooks",n$2=c=>({get:p=>c("GET",`${t$3}`,{params:p}),create:p=>c("POST",`${t$3}`,{body:p}),update:p=>c("PUT",`${t$3}`,{body:p}),delete:p=>c("DELETE",`${t$3}`,{params:p}),list:p=>c("GET",`${t$3}/list`,{params:p})}),s="/workspace",t$2=c=>({get:()=>c("GET",`${s}`)}),o$1="/roles",a$2=c=>({get:p=>c("GET",`${o$1}`,{params:p}),create:p=>c("POST",`${o$1}`,{body:p}),update:p=>c("PUT",`${o$1}`,{body:p}),delete:p=>c("DELETE",`${o$1}`,{params:p}),list:p=>c("GET",`${o$1}/list`,{params:p})}),t$1="/workspace-settings",a$1=c=>({get:()=>c("GET",`${t$1}`),update:p=>c("PUT",`${t$1}`,{body:p})}),r$1=c=>({listMembers:p=>c("GET","/workspace-memberships/list-members",{params:p}),listWorkspaces:p=>c("GET","/workspace-memberships/list-workspaces",{params:p}),create:p=>c("POST","/workspace-memberships",{body:p}),update:p=>c("PUT","/workspace-memberships",{body:p}),delete:p=>c("DELETE","/workspace-memberships",{params:p})}),e="/extension",o=c=>({get:()=>c("GET",`${e}`),getData:()=>c("GET",`${e}/data`),updateData:p=>c("PUT",`${e}/data`,{body:p}),updateContentPieceData:p=>c("POST",`${e}/content-piece-data`,{body:p})}),r="/variants",a=c=>({create:p=>c("POST",`${r}`,{body:p}),update:p=>c("PUT",`${r}`,{body:p}),delete:p=>c("DELETE",`${r}`,{params:p}),list:()=>c("GET",`${r}/list`)}),t="/transformers",n$1=c=>({create:p=>c("POST",`${t}`,{body:p}),delete:p=>c("DELETE",`${t}`,{params:p}),list:()=>c("GET",`${t}/list`)}),n="/snippets",i=c=>({get:p=>c("GET",`${n}`,{params:p}),create:p=>c("POST",`${n}`,{body:p}),update:p=>c("PUT",`${n}`,{body:p}),delete:p=>c("DELETE",`${n}`,{params:p}),list:p=>c("GET",`${n}/list`,{params:p})}),y=c=>{const{sendRequest:p,reconfigure:u,getConfig:T,getSignal:G,useSignal:h}=b(c),d={contentGroups:r$3(p),contentPieces:a$3(p),snippets:i(p),tags:e$1(p),profile:n$3(p),userSettings:r$2(p),webhooks:n$2(p),workspace:t$2(p),roles:a$2(p),workspaceSettings:a$1(p),workspaceMemberships:r$1(p),extension:o(p),variants:a(p),transformers:n$1(p),search($){return p("GET","/search",{params:$})},async ask($){let m="";const E=new w__default(`${T().baseURL}/search/ask?query=${encodeURIComponent($.query)}`,{headers:{Authorization:`Bearer ${T().token}`,"Content-Type":"application/json",Accept:"application/json"}});E.addEventListener("error",g=>{const l=g;return l.message?$.onError?.(l.message):(E.close(),$.onEnd?.(m))}),E.addEventListener("message",g=>{const l=decodeURIComponent(g.data);m+=l,$.onChunk?.(l,m)}),G()?.addEventListener("abort",()=>{E.close()}),h(null)},useSignal($){return h($),d},reconfigure($){return u($),d},getConfig(){return T()}};return d};exports.createClient=y;
package/dist/api.d.cts ADDED
@@ -0,0 +1,22 @@
1
+ export { B as Block, C as Client, a as ContentGroup, b as ContentGroupWithSubtree, E as Embed, l as Extension, L as ListedMember, k as ListedWorkspace, M as Mark, R as Role, e as RoleBaseType, f as RolePermission, S as SearchResult, d as Snippet, U as UIAccentColor, g as UserSettings, V as Variant, W as Webhook, h as WebhookEvent, i as WorkspaceDetails, j as WorkspaceSettings, c as createClient } from './shared/andesine.3cb4e565.cjs';
2
+ export { C as ContentPiece, a as ContentPieceWithAdditionalData, J as JSONContent, b as JSONContentAttrs, P as Profile, T as Tag, c as TagColor } from './shared/andesine.5e4b2db8.cjs';
3
+
4
+ interface UnauthorizedError {
5
+ message: string;
6
+ code: "UNAUTHORIZED";
7
+ }
8
+ interface BadRequestError {
9
+ message: string;
10
+ code: "BAD_REQUEST";
11
+ issues: Array<{
12
+ code: string;
13
+ path: string[];
14
+ message: string;
15
+ expected?: string;
16
+ received?: string;
17
+ validation?: string;
18
+ }>;
19
+ }
20
+ type APIError = UnauthorizedError | BadRequestError;
21
+
22
+ export type { APIError, BadRequestError, UnauthorizedError };
package/dist/api.d.mts ADDED
@@ -0,0 +1,22 @@
1
+ export { B as Block, C as Client, a as ContentGroup, b as ContentGroupWithSubtree, E as Embed, l as Extension, L as ListedMember, k as ListedWorkspace, M as Mark, R as Role, e as RoleBaseType, f as RolePermission, S as SearchResult, d as Snippet, U as UIAccentColor, g as UserSettings, V as Variant, W as Webhook, h as WebhookEvent, i as WorkspaceDetails, j as WorkspaceSettings, c as createClient } from './shared/andesine.e974d2fa.mjs';
2
+ export { C as ContentPiece, a as ContentPieceWithAdditionalData, J as JSONContent, b as JSONContentAttrs, P as Profile, T as Tag, c as TagColor } from './shared/andesine.5e4b2db8.mjs';
3
+
4
+ interface UnauthorizedError {
5
+ message: string;
6
+ code: "UNAUTHORIZED";
7
+ }
8
+ interface BadRequestError {
9
+ message: string;
10
+ code: "BAD_REQUEST";
11
+ issues: Array<{
12
+ code: string;
13
+ path: string[];
14
+ message: string;
15
+ expected?: string;
16
+ received?: string;
17
+ validation?: string;
18
+ }>;
19
+ }
20
+ type APIError = UnauthorizedError | BadRequestError;
21
+
22
+ export type { APIError, BadRequestError, UnauthorizedError };
package/dist/api.d.ts ADDED
@@ -0,0 +1,22 @@
1
+ export { B as Block, C as Client, a as ContentGroup, b as ContentGroupWithSubtree, E as Embed, l as Extension, L as ListedMember, k as ListedWorkspace, M as Mark, R as Role, e as RoleBaseType, f as RolePermission, S as SearchResult, d as Snippet, U as UIAccentColor, g as UserSettings, V as Variant, W as Webhook, h as WebhookEvent, i as WorkspaceDetails, j as WorkspaceSettings, c as createClient } from './shared/andesine.bcb7a57d.js';
2
+ export { C as ContentPiece, a as ContentPieceWithAdditionalData, J as JSONContent, b as JSONContentAttrs, P as Profile, T as Tag, c as TagColor } from './shared/andesine.5e4b2db8.js';
3
+
4
+ interface UnauthorizedError {
5
+ message: string;
6
+ code: "UNAUTHORIZED";
7
+ }
8
+ interface BadRequestError {
9
+ message: string;
10
+ code: "BAD_REQUEST";
11
+ issues: Array<{
12
+ code: string;
13
+ path: string[];
14
+ message: string;
15
+ expected?: string;
16
+ received?: string;
17
+ validation?: string;
18
+ }>;
19
+ }
20
+ type APIError = UnauthorizedError | BadRequestError;
21
+
22
+ export type { APIError, BadRequestError, UnauthorizedError };
package/dist/api.mjs ADDED
@@ -0,0 +1 @@
1
+ import f from"@sanity/eventsource";const l="/content-groups",S=t=>({get:e=>t("GET",`${l}`,{params:e}),list:e=>t("GET",`${l}/list`,{params:e}),create:e=>t("POST",`${l}`,{body:e}),update:e=>t("PUT",`${l}`,{body:e}),delete:e=>t("DELETE",`${l}`,{params:e})}),g="/content-pieces",L=t=>({get:e=>t("GET",`${g}`,{params:e}),create:e=>t("POST",`${g}`,{body:e}),update:e=>t("PUT",`${g}`,{body:e}),delete:e=>t("DELETE",`${g}`,{params:e}),list:({contentGroupId:e,...o})=>t("GET",`${g}/list`,{params:{...o,...e&&{contentGroupId:typeof e=="string"?e:e.join(",")}}})}),D=t=>{let e=t.baseURL||"https://api.vrite.io",o=t.extensionId||"",i=t.headers||{},$=null,{token:d}=t;return{sendRequest:async(s,a,c)=>{try{const{default:p}=await import("isomorphic-unfetch"),n=await p(`${e}${a}/?${encodeURI(Object.entries(c?.params||{}).filter(([,h])=>h).map(([h,U])=>`${h}=${U}`).join("&"))}`,{headers:{Authorization:`Bearer ${d}`,Accept:"application/json",...c?.body?{"Content-Type":"application/json"}:{},...o?{"X-Vrite-Extension-ID":o}:{},...i},body:c?.body?JSON.stringify(c.body):null,signal:$,method:s});$=null;let r=null;try{if(r=await n.json(),!r)return}catch{return}if(!n.ok)throw r;const P=n.headers.get("x-pagination-total");return P?Object.assign(r,{meta:{pagination:{total:parseInt(P),pages:parseInt(n.headers.get("x-pagination-pages")||"0"),perPage:parseInt(n.headers.get("x-pagination-per-page")||"0"),page:parseInt(n.headers.get("x-pagination-page")||"0")}}}):r}catch(p){throw console.error(p),p}},reconfigure:s=>{e=s.baseURL||e,d=s.token||d,o=s.extensionId||o,i=s.headers||i},useSignal:s=>{$=s},getConfig:()=>({baseURL:e,token:d,extensionId:o,headers:i}),getSignal:()=>$}},k="/user-settings",I=t=>({get:()=>t("GET",`${k}`),update:e=>t("PUT",`${k}`,{body:e})}),E="/tags",O=t=>({get:e=>t("GET",`${E}`,{params:e}),update:e=>t("PUT",`${E}`,{body:e}),create:e=>t("PUT",`${E}`,{body:e}),delete:e=>t("DELETE",`${E}`,{params:e}),list:e=>t("GET",`${E}/list`,{params:e})}),x="/profile",C=t=>({get:()=>t("GET",`${x}`)}),T="/webhooks",j=t=>({get:e=>t("GET",`${T}`,{params:e}),create:e=>t("POST",`${T}`,{body:e}),update:e=>t("PUT",`${T}`,{body:e}),delete:e=>t("DELETE",`${T}`,{params:e}),list:e=>t("GET",`${T}/list`,{params:e})}),R="/workspace",v=t=>({get:()=>t("GET",`${R}`)}),m="/roles",q=t=>({get:e=>t("GET",`${m}`,{params:e}),create:e=>t("POST",`${m}`,{body:e}),update:e=>t("PUT",`${m}`,{body:e}),delete:e=>t("DELETE",`${m}`,{params:e}),list:e=>t("GET",`${m}/list`,{params:e})}),w="/workspace-settings",A=t=>({get:()=>t("GET",`${w}`),update:e=>t("PUT",`${w}`,{body:e})}),z=t=>({listMembers:e=>t("GET","/workspace-memberships/list-members",{params:e}),listWorkspaces:e=>t("GET","/workspace-memberships/list-workspaces",{params:e}),create:e=>t("POST","/workspace-memberships",{body:e}),update:e=>t("PUT","/workspace-memberships",{body:e}),delete:e=>t("DELETE","/workspace-memberships",{params:e})}),b="/extension",B=t=>({get:()=>t("GET",`${b}`),getData:()=>t("GET",`${b}/data`),updateData:e=>t("PUT",`${b}/data`,{body:e}),updateContentPieceData:e=>t("POST",`${b}/content-piece-data`,{body:e})}),y="/variants",M=t=>({create:e=>t("POST",`${y}`,{body:e}),update:e=>t("PUT",`${y}`,{body:e}),delete:e=>t("DELETE",`${y}`,{params:e}),list:()=>t("GET",`${y}/list`)}),G="/transformers",J=t=>({create:e=>t("POST",`${G}`,{body:e}),delete:e=>t("DELETE",`${G}`,{params:e}),list:()=>t("GET",`${G}/list`)}),u="/snippets",N=t=>({get:e=>t("GET",`${u}`,{params:e}),create:e=>t("POST",`${u}`,{body:e}),update:e=>t("PUT",`${u}`,{body:e}),delete:e=>t("DELETE",`${u}`,{params:e}),list:e=>t("GET",`${u}/list`,{params:e})}),V=t=>{const{sendRequest:e,reconfigure:o,getConfig:i,getSignal:$,useSignal:d}=D(t),s={contentGroups:S(e),contentPieces:L(e),snippets:N(e),tags:O(e),profile:C(e),userSettings:I(e),webhooks:j(e),workspace:v(e),roles:q(e),workspaceSettings:A(e),workspaceMemberships:z(e),extension:B(e),variants:M(e),transformers:J(e),search(a){return e("GET","/search",{params:a})},async ask(a){let c="";const p=new f(`${i().baseURL}/search/ask?query=${encodeURIComponent(a.query)}`,{headers:{Authorization:`Bearer ${i().token}`,"Content-Type":"application/json",Accept:"application/json"}});p.addEventListener("error",n=>{const r=n;return r.message?a.onError?.(r.message):(p.close(),a.onEnd?.(c))}),p.addEventListener("message",n=>{const r=decodeURIComponent(n.data);c+=r,a.onChunk?.(r,c)}),$()?.addEventListener("abort",()=>{p.close()}),d(null)},useSignal(a){return d(a),s},reconfigure(a){return o(a),s},getConfig(){return i()}};return s};export{V as createClient};
@@ -0,0 +1 @@
1
+ "use strict";const E=Symbol("usableEnv"),c=Symbol("value"),r=Symbol("id"),d=Symbol("componentName"),i={data:{},func:{},views:{},effects:[],currentScope:null},b=async(...e)=>{await Promise.all(i.effects.filter(t=>t.dependencies.some(n=>e.includes(n))).map(t=>t.run()))},p={},x=()=>`_${Math.random().toString(36).substring(2,9)}`,o=e=>e&&(typeof e=="object"||typeof e=="function")&&r in e&&c in e,g=new Proxy({},{get(e,t){const n=()=>{};return Object.defineProperty(n,d,{value:t}),n}});function m(e){if(!i.data.temp){const s=()=>i.data.temp[c];Object.defineProperty(s,r,{value:"temp"}),Object.defineProperty(s,c,{value:{},writable:!0}),i.data.temp=s}const t=x(),n=s=>{const a=i.data.temp;a[c][t]&&(a[c][t][c]=s),b(`temp.${t}`)},u=()=>i.data.temp[c][t][c];return Object.defineProperty(u,r,{value:`temp.${t}`}),Object.defineProperty(u,c,{value:e,writable:!0}),i.data.temp[c][t]=u,i.currentScope&&i.currentScope.temp.push(t),[u,n]}function C(e,t,n){const u=x();i.effects.push({[r]:u,dependencies:t.map(s=>s[r]),run:e}),i.currentScope&&i.currentScope.effects.push(u),n?.initial&&e()}const l=Object.assign(function(e,t){const[n,u]=m(e());return C(()=>{u(e())},t,{initial:!0}),n},{eq:(...e)=>{const t=e.filter(o);return l(()=>e.every(n=>(o(n)?n():n)===(o(e[0])?e[0]():e[0])),t)},neq:(...e)=>{const t=e.filter(o);return l(()=>e.some(n=>(o(n)?n():n)!==(o(e[0])?e[0]():e[0])),t)},gt:(e,t)=>{const n=[...o(e)?[e]:[],...o(t)?[t]:[]];return l(()=>(o(e)?e():e)>(o(t)?t():t),n)},lt:(e,t)=>{const n=[...o(e)?[e]:[],...o(t)?[t]:[]];return l(()=>(o(e)?e():e)<(o(t)?t():t),n)},and:(...e)=>{const t=e.filter(o);return l(()=>e.every(n=>o(n)?n():n),t)},or:(...e)=>{const t=e.filter(o);return l(()=>e.some(n=>o(n)?n():n),t)},not:e=>l(()=>!(o(e)?e():e),o(e)?[e]:[]),add:(...e)=>{const t=e.filter(o);return l(()=>e.reduce((n,u)=>n+(o(u)?u():u),0),t)},join:(...e)=>{const t=e.filter(o);return l(()=>e.reduce((n,u)=>n+(o(u)?u():u),""),t)},sub:(...e)=>{const t=e.filter(o);return l(()=>e.reduce((n,u)=>n-u(),0),t)},mul:(...e)=>{const t=e.filter(o);return l(()=>e.reduce((n,u)=>n*u(),1),t)},div:(e,t)=>{const n=[...o(e)?[e]:[],...o(t)?[t]:[]];return l(()=>(o(e)?e():e)/(o(t)?t():t),n)},mod:(e,t)=>{const n=[...o(e)?[e]:[],...o(t)?[t]:[]];return l(()=>(o(e)?e():e)%(o(t)?t():t),n)},neg:e=>l(()=>-(o(e)?e():e),o(e)?[e]:[]),when:(e,t,n)=>{const u=o(e)?[e]:[],s=o(t)?[t]:[],a=o(n)?[n]:[];return l(()=>(o(e)?e():e)?o(t)?t():t:n?o(n)?n():n:null,[...u,...s,...a])}}),f=e=>{const t=x(),n=e;return Object.defineProperty(n,r,{value:t}),i.func[t]=n,i.currentScope&&i.currentScope.func.push(t),n},y=(e,t,...n)=>({component:e[d]||"Fragment",slot:n,props:Object.fromEntries(Object.keys(t||{}).map(u=>{const s=t[u];return s&&s[r]?[u,s[r]]:[u,s]}))}),v=(...e)=>({component:"Fragment",slot:e,props:{}}),_=e=>{const t=x(),n={[r]:t,[c]:e};return i.views[t]=n,n},V=e=>{const t=p[e];t&&(t.func.forEach(n=>{delete i.func[n]}),t.temp.forEach(n=>{const u=i.data.temp;u()&&delete u()[n]}),t.effects.forEach(n=>{i.effects=i.effects.filter(u=>u[r]!==n)}))},w=e=>({getEnvironment:()=>i,getMetadata:()=>({__value:c,__id:r,__componentName:d,__usableEnv:E}),triggerEffects:b,generateRuntimeSpec:()=>({...e,onUninstall:e.onUninstall?.[r],onConfigure:e.onConfigure?.[r],configurationView:e.configurationView?.[r],contentPieceView:e.contentPieceView?.[r],blockActions:e.blockActions?.map(t=>({...t,view:t.view[r]})),elements:e.elements?.map(t=>({...t,view:t.view[r]})),page:e.page&&{mainView:e.page.mainView?.[r],sidePanelView:e.page.sidePanelView?.[r]}||void 0}),generateView:async(t,n,u)=>{const s=i.views[t]?.[c];if(s){i.currentScope={func:[],temp:[],effects:[],uid:u};const a=await s(n);return p[`view:${u}`]=i.currentScope,i.currentScope=null,a}return{component:"",slot:[]}},runFunction:async(t,n,u)=>{const s=i.func[t];s&&(i.currentScope={func:[],temp:[],effects:[],uid:u},await s(n),p[`func:${u}`]=i.currentScope,i.currentScope=null,V(`func:${u}`))},removeScope:V});exports.Components=g,exports.computed=l,exports.createElement=y,exports.createFragment=v,exports.createFunction=f,exports.createRuntime=w,exports.createTemp=m,exports.createView=_,exports.effect=C,exports.generateId=x,exports.isVal=o;
@@ -0,0 +1,351 @@
1
+ import { C as Client } from './shared/andesine.3cb4e565.cjs';
2
+ import { a as ContentPieceWithAdditionalData, J as JSONContent } from './shared/andesine.5e4b2db8.cjs';
3
+
4
+ type ContextValue = string | number | boolean | undefined | null | ContextObject | ContextArray;
5
+ type ContextObject = {
6
+ [x: string]: ContextValue;
7
+ };
8
+ type ContextArray = Array<ContextValue>;
9
+ type IsFunction<T, R, Fallback = T> = T extends (...args: any[]) => any ? R : Fallback;
10
+ type IsObject<T, R, Fallback = T> = IsFunction<T, Fallback, T extends object ? (T extends any[] ? Fallback : R) : Fallback>;
11
+ type Tail<S> = S extends `${string}.${infer T}` ? Tail<T> : S;
12
+ type Value<T> = T[keyof T];
13
+ type FlattenStepOne<T> = {
14
+ [K in keyof T as K extends string ? IsObject<T[K], `${K}.${keyof T[K] & string}`, K> : K]: IsObject<T[K], {
15
+ [key in keyof T[K]]: T[K][key];
16
+ }>;
17
+ };
18
+ type FlattenStepTwo<T> = {
19
+ [a in keyof T]: IsObject<T[a], Value<{
20
+ [M in keyof T[a] as M extends Tail<a> ? M : never]: T[a][M];
21
+ }>>;
22
+ };
23
+ type FlattenOneLevel<T> = FlattenStepTwo<FlattenStepOne<T>>;
24
+ type Flatten<T> = T extends FlattenOneLevel<T> ? T : Flatten<FlattenOneLevel<T>>;
25
+ type UsableEnv<R extends ContextObject = ContextObject, W extends ContextObject = ContextObject> = {
26
+ readable: R;
27
+ writable: W;
28
+ };
29
+ type ExtensionContentType = "paragraph" | "heading" | "blockquote" | "element" | "image" | "codeBlock" | "embed" | "bulletList" | "orderedList" | "taskList" | "horizontalRule" | "table" | "block";
30
+ type UseEnv<C extends ExtensionBaseContext> = C[typeof __usableEnv] extends UsableEnv ? <K extends keyof Flatten<C[typeof __usableEnv]["readable"]> | keyof Flatten<C[typeof __usableEnv]["writable"]> | keyof C[typeof __usableEnv]["readable"] | keyof C[typeof __usableEnv]["writable"]>(key: K) => K extends keyof Flatten<C[typeof __usableEnv]["readable"]> ? Val<Flatten<C[typeof __usableEnv]["readable"]>[K]> : K extends keyof Flatten<C[typeof __usableEnv]["writable"]> ? [
31
+ MutableVal<Flatten<C[typeof __usableEnv]["writable"]>[K]>,
32
+ (value: Flatten<C[typeof __usableEnv]["writable"]>[K]) => void
33
+ ] : K extends keyof C[typeof __usableEnv]["readable"] ? Val<C[typeof __usableEnv]["readable"][K]> : K extends keyof C[typeof __usableEnv]["writable"] ? [
34
+ MutableVal<C[typeof __usableEnv]["writable"][K]>,
35
+ (value: C[typeof __usableEnv]["writable"][K]) => void
36
+ ] : never : never;
37
+ interface ExtensionBaseContext<C extends ContextObject = ContextObject> {
38
+ client: Omit<Client, "reconfigure">;
39
+ token: string;
40
+ extensionId: string;
41
+ config?: C;
42
+ spec: ExtensionSpec;
43
+ [__usableEnv]: UsableEnv<any, any>;
44
+ use: UseEnv<this>;
45
+ flush(): Promise<void>;
46
+ notify(message: {
47
+ text: string;
48
+ type: "success" | "error";
49
+ }): Promise<void>;
50
+ }
51
+ interface ExtensionBaseViewContext<C extends ContextObject = ContextObject> extends ExtensionBaseContext<C> {
52
+ css(strings: TemplateStringsArray, ...values: Array<ContextValue>): string;
53
+ }
54
+ interface ExtensionConfigurationViewContext<C extends ContextObject = ContextObject> extends ExtensionBaseViewContext<C> {
55
+ [__usableEnv]: UsableEnv<{
56
+ [__value]: any;
57
+ }, {
58
+ config: C;
59
+ }>;
60
+ }
61
+ interface ExtensionContentPieceViewContext<C extends ContextObject = ContextObject, D extends ContextObject = ContextObject> extends ExtensionBaseViewContext<C> {
62
+ [__usableEnv]: UsableEnv<{
63
+ contentPiece: ContentPieceWithAdditionalData;
64
+ }, {
65
+ data: D;
66
+ }>;
67
+ }
68
+ interface ExtensionBlockActionViewContext<C extends ContextObject = ContextObject> extends ExtensionBaseViewContext<C> {
69
+ [__usableEnv]: UsableEnv<{
70
+ content: JSONContent;
71
+ }, {
72
+ [__value]: any;
73
+ }>;
74
+ replaceContent(contentHTML: string): Promise<void>;
75
+ refreshContent(): Promise<void>;
76
+ }
77
+ interface ExtensionElementViewContext<C extends ContextObject = ContextObject, P extends Record<string, any> = Record<string, any>> extends ExtensionBaseViewContext<C> {
78
+ [__usableEnv]: UsableEnv<{
79
+ [__value]: any;
80
+ }, {
81
+ props: P;
82
+ }>;
83
+ }
84
+ declare const __brand: unique symbol;
85
+ declare const __props: unique symbol;
86
+ declare const __mutable: unique symbol;
87
+ declare const __usableEnv: unique symbol;
88
+ declare const __value: unique symbol;
89
+ declare const __id: unique symbol;
90
+ declare const __componentName: unique symbol;
91
+ type Brand<B> = {
92
+ [__brand]: B;
93
+ };
94
+ type Val<V extends ContextValue | {
95
+ [K: string]: Val;
96
+ } = ContextValue | {
97
+ [K: string]: Val;
98
+ }> = Brand<"Val"> & {
99
+ (): V;
100
+ [__value]: V;
101
+ [__id]: string;
102
+ };
103
+ type MutableVal<V extends ContextValue | {
104
+ [K: string]: MutableVal;
105
+ } = ContextValue | {
106
+ [K: string]: MutableVal;
107
+ }> = Val<V> & {
108
+ [__mutable]: true;
109
+ };
110
+ type Func<C extends ExtensionBaseContext | never = never> = Brand<"Func"> & {
111
+ (context: C): void | Promise<void>;
112
+ [__id]: string;
113
+ };
114
+ interface ExtensionEnvironment {
115
+ data: Record<string, Val>;
116
+ func: Record<string, Func<any>>;
117
+ views: Record<string, View<any>>;
118
+ effects: Array<{
119
+ [__id]: string;
120
+ dependencies: string[];
121
+ run: () => void;
122
+ }>;
123
+ currentScope: {
124
+ func: string[];
125
+ temp: string[];
126
+ effects: string[];
127
+ uid: string;
128
+ } | null;
129
+ }
130
+ interface ExtensionMetadata {
131
+ __value: typeof __value;
132
+ __id: typeof __id;
133
+ __componentName: typeof __componentName;
134
+ __usableEnv: typeof __usableEnv;
135
+ }
136
+ type View<C extends Partial<ExtensionBaseViewContext> | never = never> = Brand<"View"> & {
137
+ [__value]: (context: C) => ExtensionElement | Promise<ExtensionElement>;
138
+ [__id]: string;
139
+ };
140
+ interface ExtensionSpec {
141
+ name: string;
142
+ description: string;
143
+ displayName: string;
144
+ permissions: string[];
145
+ runtime: string;
146
+ icon: string;
147
+ iconDark?: string;
148
+ }
149
+ interface ExtensionBlockActionSpec {
150
+ id: string;
151
+ label: string;
152
+ blocks: string[];
153
+ view: string;
154
+ }
155
+ interface ExtensionPageSpec {
156
+ mainView?: string;
157
+ sidePanelView?: string;
158
+ }
159
+ interface ExtensionElementSpec {
160
+ type: string;
161
+ view: string;
162
+ }
163
+ interface ExtensionRuntimeSpec {
164
+ onUninstall?: string;
165
+ onConfigure?: string;
166
+ configurationView?: string;
167
+ contentPieceView?: string;
168
+ blockActions?: ExtensionBlockActionSpec[];
169
+ page?: ExtensionPageSpec;
170
+ elements?: ExtensionElementSpec[];
171
+ }
172
+ interface Extension {
173
+ getMetadata: () => ExtensionMetadata;
174
+ getEnvironment: () => ExtensionEnvironment;
175
+ triggerEffects: (...dependencies: string[]) => Promise<void>;
176
+ generateRuntimeSpec: () => ExtensionRuntimeSpec;
177
+ generateView: <C extends ExtensionBaseViewContext>(id: string, context: C, uid: string) => Promise<ExtensionElement>;
178
+ removeScope: (id: string) => void;
179
+ runFunction: <C extends ExtensionBaseContext | never = never>(id: string, context: C, uid: string) => Promise<void>;
180
+ }
181
+ type BaseProps<P extends Record<string, any>> = {
182
+ [K in keyof P as Exclude<K, symbol>]?: P[K];
183
+ };
184
+ type BindableProps<P extends Record<string, any>, M extends string | never = never> = {
185
+ [K in keyof P as `bind:${Exclude<Exclude<K, symbol>, M>}`]?: Val<P[K]>;
186
+ } & {
187
+ [K in keyof P as `bind:${Extract<Exclude<K, symbol>, M>}`]?: MutableVal<P[K]>;
188
+ };
189
+ type EventProps<E extends string | never> = {
190
+ [K in E as `on:${Exclude<K, symbol>}`]?: Func;
191
+ };
192
+ interface ExtensionBaseComponent<P extends Record<string, any> = Record<string, any>, E extends string | never = never, M extends string | never = never> {
193
+ (props: BaseProps<P> & BindableProps<P, M> & EventProps<E>): void;
194
+ [__componentName]: string;
195
+ [__props]: P;
196
+ }
197
+ interface ExtensionBaseComponents {
198
+ Content: ExtensionBaseComponent<{
199
+ allowed?: ExtensionContentType[];
200
+ initial?: string;
201
+ class?: string;
202
+ wrapperClass?: string;
203
+ }>;
204
+ Element: ExtensionBaseComponent<{
205
+ type: string;
206
+ }>;
207
+ View: ExtensionBaseComponent<{
208
+ class: string;
209
+ }>;
210
+ SidePanelHeader: ExtensionBaseComponent<{
211
+ defaultSection: string;
212
+ section: string;
213
+ sections: Array<{
214
+ label: string;
215
+ icon?: string;
216
+ id: string;
217
+ action?: ExtensionElement;
218
+ }>;
219
+ }, "back">;
220
+ SidePanelContent: ExtensionBaseComponent<{}>;
221
+ Field: ExtensionBaseComponent<{
222
+ type: string;
223
+ color: "base" | "contrast";
224
+ label: string;
225
+ textarea: boolean;
226
+ value?: string | boolean;
227
+ disabled: boolean;
228
+ placeholder: string;
229
+ optional: boolean;
230
+ options?: Array<{
231
+ label: string;
232
+ value: string;
233
+ }>;
234
+ }, "change", "value">;
235
+ Select: ExtensionBaseComponent<{
236
+ options: Array<{
237
+ label: string;
238
+ value: string;
239
+ }>;
240
+ value?: string;
241
+ class?: string;
242
+ placeholder?: string;
243
+ color?: "base" | "contrast";
244
+ wrapperClass?: string;
245
+ }, "change", "value">;
246
+ Tooltip: ExtensionBaseComponent<{
247
+ text: string;
248
+ class: string;
249
+ fixed: boolean;
250
+ side?: "top" | "bottom" | "left" | "right";
251
+ }>;
252
+ Button: ExtensionBaseComponent<{
253
+ color: "base" | "contrast" | "primary" | "danger" | "success";
254
+ text: "base" | "contrast" | "primary" | "soft" | "danger" | "success";
255
+ class: string;
256
+ loading: boolean;
257
+ disabled: boolean;
258
+ hover: boolean;
259
+ badge: boolean;
260
+ variant: "text" | "solid";
261
+ size: "small" | "medium" | "large";
262
+ target: string;
263
+ link: string;
264
+ }, "click">;
265
+ Card: ExtensionBaseComponent<{
266
+ color: "base" | "contrast" | "primary";
267
+ class: string;
268
+ }>;
269
+ Icon: ExtensionBaseComponent<{
270
+ path: string;
271
+ class: string;
272
+ }>;
273
+ IconButton: ExtensionBaseComponent<{
274
+ color: "base" | "contrast" | "primary";
275
+ text: "base" | "contrast" | "primary" | "soft";
276
+ path: string;
277
+ class: string;
278
+ loading: boolean;
279
+ disabled: boolean;
280
+ }, "click">;
281
+ CollapsibleSection: ExtensionBaseComponent<{
282
+ icon: string;
283
+ label: string;
284
+ action?: ExtensionElement;
285
+ color?: "base" | "primary";
286
+ defaultOpened?: boolean;
287
+ }>;
288
+ Switch: ExtensionBaseComponent<{}>;
289
+ Match: ExtensionBaseComponent<{
290
+ when?: ContextValue;
291
+ }>;
292
+ Show: ExtensionBaseComponent<{
293
+ when: ContextValue;
294
+ }>;
295
+ Text: ExtensionBaseComponent<{
296
+ content: ContextValue;
297
+ }>;
298
+ }
299
+ type ExtensionElement = {
300
+ slot: Array<ExtensionElement | string>;
301
+ component: string;
302
+ props?: Record<string, string | boolean | number>;
303
+ };
304
+ interface ExtensionRuntimeConfig<C extends ContextObject = ContextObject> {
305
+ onUninstall?: Func<ExtensionBaseContext<C>>;
306
+ onConfigure?: Func<ExtensionBaseContext<C>>;
307
+ configurationView?: View<ExtensionConfigurationViewContext<C>>;
308
+ contentPieceView?: View<ExtensionContentPieceViewContext<C>>;
309
+ blockActions?: Array<Omit<ExtensionBlockActionSpec, "view"> & {
310
+ view: View<ExtensionBlockActionViewContext<C>>;
311
+ }>;
312
+ elements?: Array<Omit<ExtensionElementSpec, "view"> & {
313
+ view: View<ExtensionElementViewContext<C, any>>;
314
+ }>;
315
+ page?: {
316
+ mainView?: View<ExtensionBaseViewContext<C>>;
317
+ sidePanelView?: View<ExtensionBaseViewContext<C>>;
318
+ };
319
+ }
320
+ declare const generateId: () => string;
321
+ declare const isVal: <T extends ContextValue>(value: T | Val<T>) => value is Val<T>;
322
+ declare const Components: ExtensionBaseComponents;
323
+ declare function createTemp<T extends ContextValue>(initialValue: T): [MutableVal<T>, (value: T) => void];
324
+ declare function createTemp<T extends ContextValue>(initialValue?: T): [MutableVal<T | undefined>, (value: T | undefined) => void];
325
+ declare function effect<D extends Val[]>(run: () => void, dependencies: D, options?: {
326
+ initial?: boolean;
327
+ }): void;
328
+ declare const computed: (<O extends ContextValue>(compute: () => O, dependencies: Val[]) => Val<O>) & {
329
+ eq: (...values: Array<Val<ContextValue> | ContextValue>) => Val<boolean>;
330
+ neq: (...values: Array<Val<ContextValue> | ContextValue>) => Val<boolean>;
331
+ gt: (a: number | Val<number>, b: number | Val<number>) => Val<boolean>;
332
+ lt: (a: number | Val<number>, b: number | Val<number>) => Val<boolean>;
333
+ and: (...values: Array<Val<ContextValue> | ContextValue>) => Val<boolean>;
334
+ or: (...values: Array<Val<ContextValue> | ContextValue>) => Val<boolean>;
335
+ not: (value: Val<ContextValue> | ContextValue) => Val<boolean>;
336
+ add: (...values: Array<Val<number> | number>) => Val<number>;
337
+ join: (...values: Array<Val<string> | string>) => Val<string>;
338
+ sub: (...values: Val<number>[]) => Val<number>;
339
+ mul: (...values: Val<number>[]) => Val<number>;
340
+ div: (a: number | Val<number>, b: number | Val<number>) => Val<number>;
341
+ mod: (a: number | Val<number>, b: number | Val<number>) => Val<number>;
342
+ neg: (value: number | Val<number>) => Val<number>;
343
+ when: <T extends ContextValue, F extends ContextValue = undefined>(condition: ContextValue | Val<ContextValue>, ifTrue: T | Val<T>, ifFalse?: F | Val<F>) => F extends undefined ? Val<T | null> : Val<T>;
344
+ };
345
+ declare const createFunction: <C extends ExtensionBaseContext | never = never>(run: (context: C) => void) => Func<C>;
346
+ declare const createElement: <C extends ExtensionBaseComponent<any>>(component: C, props: C[typeof __props], ...children: Array<ExtensionElement | string>) => ExtensionElement;
347
+ declare const createFragment: (...children: Array<ExtensionElement | string>) => ExtensionElement;
348
+ declare const createView: <C extends ExtensionBaseViewContext>(run: (context: C) => ExtensionElement) => View<C>;
349
+ declare const createRuntime: <C extends ContextObject = ContextObject>(runtimeConfig: ExtensionRuntimeConfig<C>) => Extension;
350
+
351
+ export { type Brand, Components, type ContextObject, type ContextValue, type Extension, type ExtensionBaseComponents, type ExtensionBaseContext, type ExtensionBaseViewContext, type ExtensionBlockActionSpec, type ExtensionBlockActionViewContext, type ExtensionConfigurationViewContext, type ExtensionContentPieceViewContext, type ExtensionContentType, type ExtensionElement, type ExtensionElementSpec, type ExtensionElementViewContext, type ExtensionEnvironment, type ExtensionMetadata, type ExtensionRuntimeSpec, type ExtensionSpec, type Func, type MutableVal, type Val, type View, computed, createElement, createFragment, createFunction, createRuntime, createTemp, createView, effect, generateId, isVal };