@makeswift/runtime 0.28.10-canary.16 → 0.28.10-canary.18
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/dist/cjs/api/graphql-api-client.js +1 -1
- package/dist/cjs/api/rest-api-client.js +1 -1
- package/dist/cjs/api-handler/handlers/manifest.js +1 -1
- package/dist/cjs/slate/LinkPlugin/index.js +1 -1
- package/dist/cjs/slate/LinkPlugin/index.js.map +1 -1
- package/dist/esm/api/graphql-api-client.js +1 -1
- package/dist/esm/api/rest-api-client.js +1 -1
- package/dist/esm/api-handler/handlers/manifest.js +1 -1
- package/dist/esm/slate/LinkPlugin/index.js +1 -1
- package/dist/esm/slate/LinkPlugin/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -27,7 +27,7 @@ class MakeswiftGraphQLApiClient {
|
|
|
27
27
|
graphqlClient;
|
|
28
28
|
constructor({ endpoint }) {
|
|
29
29
|
this.graphqlClient = new import_client.GraphQLClient(endpoint, {
|
|
30
|
-
"makeswift-runtime-version": "0.28.10-canary.
|
|
30
|
+
"makeswift-runtime-version": "0.28.10-canary.18"
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
async getUnversionedResources({
|
|
@@ -198,7 +198,7 @@ class MakeswiftRestAPIClient {
|
|
|
198
198
|
const requestHeaders = new Headers({
|
|
199
199
|
"x-api-key": this.apiKey,
|
|
200
200
|
"makeswift-site-api-key": this.apiKey,
|
|
201
|
-
"makeswift-runtime-version": "0.28.10-canary.
|
|
201
|
+
"makeswift-runtime-version": "0.28.10-canary.18"
|
|
202
202
|
});
|
|
203
203
|
if (siteVersion?.token) {
|
|
204
204
|
requestUrl.searchParams.set("version", siteVersion.version);
|
|
@@ -28,7 +28,7 @@ async function manifestHandler(req, { apiKey, manifest }) {
|
|
|
28
28
|
return import_request_response.ApiResponse.json({ message: "Unauthorized" }, { status: 401 });
|
|
29
29
|
}
|
|
30
30
|
return import_request_response.ApiResponse.json({
|
|
31
|
-
version: "0.28.10-canary.
|
|
31
|
+
version: "0.28.10-canary.18",
|
|
32
32
|
interactionMode: true,
|
|
33
33
|
clientSideNavigation: false,
|
|
34
34
|
elementFromPoint: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/slate/LinkPlugin/index.tsx"],"sourcesContent":["import { cx } from '@emotion/css'\nimport { type Editor, Element } from 'slate'\nimport { type RenderElementProps } from 'slate-react'\nimport { Slate } from '@makeswift/controls'\n\nimport { Link } from '../../controls/link'\nimport { useStyle } from '../../runtimes/react/use-style'\nimport { Link as LinkComponent } from '../../components/shared/Link'\nimport { type RenderElement, Plugin } from '../../controls/rich-text-v2/plugin'\n\nimport { onChange } from './onChange'\nimport { getValue } from './getValue'\n\nexport const withLink = (editor: Editor) => {\n const { isInline } = editor\n\n editor.isInline = entry => {\n return Slate.isInline(entry) && isInline(entry)\n }\n\n return editor\n}\n\nfunction InlinePluginComponent({\n element,\n attributes,\n children,\n renderElement,\n}: RenderElementProps & { renderElement: RenderElement }) {\n const linkStyle = useStyle({ textDecoration: 'none' })\n switch (element.type) {\n case Slate.InlineType.Link:\n return (\n <LinkComponent\n {...attributes}\n link={element.link ?? undefined}\n className={cx(linkStyle, element.className)}\n >\n {renderElement({\n element,\n attributes,\n children,\n })}\n </LinkComponent>\n )\n\n default:\n return (\n <>\n {renderElement({\n element,\n attributes,\n children,\n })}\n </>\n )\n }\n}\n\nexport function LinkPlugin() {\n return Plugin({\n control: {\n definition: Link({\n label: 'On
|
|
1
|
+
{"version":3,"sources":["../../../../src/slate/LinkPlugin/index.tsx"],"sourcesContent":["import { cx } from '@emotion/css'\nimport { type Editor, Element } from 'slate'\nimport { type RenderElementProps } from 'slate-react'\nimport { Slate } from '@makeswift/controls'\n\nimport { Link } from '../../controls/link'\nimport { useStyle } from '../../runtimes/react/use-style'\nimport { Link as LinkComponent } from '../../components/shared/Link'\nimport { type RenderElement, Plugin } from '../../controls/rich-text-v2/plugin'\n\nimport { onChange } from './onChange'\nimport { getValue } from './getValue'\n\nexport const withLink = (editor: Editor) => {\n const { isInline } = editor\n\n editor.isInline = entry => {\n return Slate.isInline(entry) && isInline(entry)\n }\n\n return editor\n}\n\nfunction InlinePluginComponent({\n element,\n attributes,\n children,\n renderElement,\n}: RenderElementProps & { renderElement: RenderElement }) {\n const linkStyle = useStyle({ textDecoration: 'none' })\n switch (element.type) {\n case Slate.InlineType.Link:\n return (\n <LinkComponent\n {...attributes}\n link={element.link ?? undefined}\n className={cx(linkStyle, element.className)}\n >\n {renderElement({\n element,\n attributes,\n children,\n })}\n </LinkComponent>\n )\n\n default:\n return (\n <>\n {renderElement({\n element,\n attributes,\n children,\n })}\n </>\n )\n }\n}\n\nexport function LinkPlugin() {\n return Plugin({\n control: {\n definition: Link({\n label: 'On click',\n }),\n onChange,\n getValue,\n getElementValue: (element: Element) => {\n return Slate.isLink(element) ? element.link : undefined\n },\n },\n withPlugin: withLink,\n renderElement: renderElement => props => {\n return <InlinePluginComponent {...props} renderElement={renderElement} />\n },\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiCQ;AAjCR,iBAAmB;AAGnB,sBAAsB;AAEtB,kBAAqB;AACrB,uBAAyB;AACzB,kBAAsC;AACtC,oBAA2C;AAE3C,sBAAyB;AACzB,sBAAyB;AAElB,MAAM,WAAW,CAAC,WAAmB;AAC1C,QAAM,EAAE,SAAS,IAAI;AAErB,SAAO,WAAW,WAAS;AACzB,WAAO,sBAAM,SAAS,KAAK,KAAK,SAAS,KAAK;AAAA,EAChD;AAEA,SAAO;AACT;AAEA,SAAS,sBAAsB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA0D;AACxD,QAAM,gBAAY,2BAAS,EAAE,gBAAgB,OAAO,CAAC;AACrD,UAAQ,QAAQ,MAAM;AAAA,IACpB,KAAK,sBAAM,WAAW;AACpB,aACE;AAAA,QAAC,YAAAA;AAAA,QAAA;AAAA,UACE,GAAG;AAAA,UACJ,MAAM,QAAQ,QAAQ;AAAA,UACtB,eAAW,eAAG,WAAW,QAAQ,SAAS;AAAA,UAEzC,wBAAc;AAAA,YACb;AAAA,YACA;AAAA,YACA;AAAA,UACF,CAAC;AAAA;AAAA,MACH;AAAA,IAGJ;AACE,aACE,2EACG,wBAAc;AAAA,QACb;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC,GACH;AAAA,EAEN;AACF;AAEO,SAAS,aAAa;AAC3B,aAAO,sBAAO;AAAA,IACZ,SAAS;AAAA,MACP,gBAAY,kBAAK;AAAA,QACf,OAAO;AAAA,MACT,CAAC;AAAA,MACD;AAAA,MACA;AAAA,MACA,iBAAiB,CAAC,YAAqB;AACrC,eAAO,sBAAM,OAAO,OAAO,IAAI,QAAQ,OAAO;AAAA,MAChD;AAAA,IACF;AAAA,IACA,YAAY;AAAA,IACZ,eAAe,mBAAiB,WAAS;AACvC,aAAO,4CAAC,yBAAuB,GAAG,OAAO,eAA8B;AAAA,IACzE;AAAA,EACF,CAAC;AACH;","names":["LinkComponent"]}
|
|
@@ -4,7 +4,7 @@ class MakeswiftGraphQLApiClient {
|
|
|
4
4
|
graphqlClient;
|
|
5
5
|
constructor({ endpoint }) {
|
|
6
6
|
this.graphqlClient = new GraphQLClient(endpoint, {
|
|
7
|
-
"makeswift-runtime-version": "0.28.10-canary.
|
|
7
|
+
"makeswift-runtime-version": "0.28.10-canary.18"
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
10
|
async getUnversionedResources({
|
|
@@ -163,7 +163,7 @@ class MakeswiftRestAPIClient {
|
|
|
163
163
|
const requestHeaders = new Headers({
|
|
164
164
|
"x-api-key": this.apiKey,
|
|
165
165
|
"makeswift-site-api-key": this.apiKey,
|
|
166
|
-
"makeswift-runtime-version": "0.28.10-canary.
|
|
166
|
+
"makeswift-runtime-version": "0.28.10-canary.18"
|
|
167
167
|
});
|
|
168
168
|
if (siteVersion?.token) {
|
|
169
169
|
requestUrl.searchParams.set("version", siteVersion.version);
|
|
@@ -8,7 +8,7 @@ async function manifestHandler(req, { apiKey, manifest }) {
|
|
|
8
8
|
return ApiResponse.json({ message: "Unauthorized" }, { status: 401 });
|
|
9
9
|
}
|
|
10
10
|
return ApiResponse.json({
|
|
11
|
-
version: "0.28.10-canary.
|
|
11
|
+
version: "0.28.10-canary.18",
|
|
12
12
|
interactionMode: true,
|
|
13
13
|
clientSideNavigation: false,
|
|
14
14
|
elementFromPoint: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/slate/LinkPlugin/index.tsx"],"sourcesContent":["import { cx } from '@emotion/css'\nimport { type Editor, Element } from 'slate'\nimport { type RenderElementProps } from 'slate-react'\nimport { Slate } from '@makeswift/controls'\n\nimport { Link } from '../../controls/link'\nimport { useStyle } from '../../runtimes/react/use-style'\nimport { Link as LinkComponent } from '../../components/shared/Link'\nimport { type RenderElement, Plugin } from '../../controls/rich-text-v2/plugin'\n\nimport { onChange } from './onChange'\nimport { getValue } from './getValue'\n\nexport const withLink = (editor: Editor) => {\n const { isInline } = editor\n\n editor.isInline = entry => {\n return Slate.isInline(entry) && isInline(entry)\n }\n\n return editor\n}\n\nfunction InlinePluginComponent({\n element,\n attributes,\n children,\n renderElement,\n}: RenderElementProps & { renderElement: RenderElement }) {\n const linkStyle = useStyle({ textDecoration: 'none' })\n switch (element.type) {\n case Slate.InlineType.Link:\n return (\n <LinkComponent\n {...attributes}\n link={element.link ?? undefined}\n className={cx(linkStyle, element.className)}\n >\n {renderElement({\n element,\n attributes,\n children,\n })}\n </LinkComponent>\n )\n\n default:\n return (\n <>\n {renderElement({\n element,\n attributes,\n children,\n })}\n </>\n )\n }\n}\n\nexport function LinkPlugin() {\n return Plugin({\n control: {\n definition: Link({\n label: 'On
|
|
1
|
+
{"version":3,"sources":["../../../../src/slate/LinkPlugin/index.tsx"],"sourcesContent":["import { cx } from '@emotion/css'\nimport { type Editor, Element } from 'slate'\nimport { type RenderElementProps } from 'slate-react'\nimport { Slate } from '@makeswift/controls'\n\nimport { Link } from '../../controls/link'\nimport { useStyle } from '../../runtimes/react/use-style'\nimport { Link as LinkComponent } from '../../components/shared/Link'\nimport { type RenderElement, Plugin } from '../../controls/rich-text-v2/plugin'\n\nimport { onChange } from './onChange'\nimport { getValue } from './getValue'\n\nexport const withLink = (editor: Editor) => {\n const { isInline } = editor\n\n editor.isInline = entry => {\n return Slate.isInline(entry) && isInline(entry)\n }\n\n return editor\n}\n\nfunction InlinePluginComponent({\n element,\n attributes,\n children,\n renderElement,\n}: RenderElementProps & { renderElement: RenderElement }) {\n const linkStyle = useStyle({ textDecoration: 'none' })\n switch (element.type) {\n case Slate.InlineType.Link:\n return (\n <LinkComponent\n {...attributes}\n link={element.link ?? undefined}\n className={cx(linkStyle, element.className)}\n >\n {renderElement({\n element,\n attributes,\n children,\n })}\n </LinkComponent>\n )\n\n default:\n return (\n <>\n {renderElement({\n element,\n attributes,\n children,\n })}\n </>\n )\n }\n}\n\nexport function LinkPlugin() {\n return Plugin({\n control: {\n definition: Link({\n label: 'On click',\n }),\n onChange,\n getValue,\n getElementValue: (element: Element) => {\n return Slate.isLink(element) ? element.link : undefined\n },\n },\n withPlugin: withLink,\n renderElement: renderElement => props => {\n return <InlinePluginComponent {...props} renderElement={renderElement} />\n },\n })\n}\n"],"mappings":"AAiCQ,SAeA,UAfA;AAjCR,SAAS,UAAU;AAGnB,SAAS,aAAa;AAEtB,SAAS,YAAY;AACrB,SAAS,gBAAgB;AACzB,SAAS,QAAQ,qBAAqB;AACtC,SAA6B,cAAc;AAE3C,SAAS,gBAAgB;AACzB,SAAS,gBAAgB;AAElB,MAAM,WAAW,CAAC,WAAmB;AAC1C,QAAM,EAAE,SAAS,IAAI;AAErB,SAAO,WAAW,WAAS;AACzB,WAAO,MAAM,SAAS,KAAK,KAAK,SAAS,KAAK;AAAA,EAChD;AAEA,SAAO;AACT;AAEA,SAAS,sBAAsB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA0D;AACxD,QAAM,YAAY,SAAS,EAAE,gBAAgB,OAAO,CAAC;AACrD,UAAQ,QAAQ,MAAM;AAAA,IACpB,KAAK,MAAM,WAAW;AACpB,aACE;AAAA,QAAC;AAAA;AAAA,UACE,GAAG;AAAA,UACJ,MAAM,QAAQ,QAAQ;AAAA,UACtB,WAAW,GAAG,WAAW,QAAQ,SAAS;AAAA,UAEzC,wBAAc;AAAA,YACb;AAAA,YACA;AAAA,YACA;AAAA,UACF,CAAC;AAAA;AAAA,MACH;AAAA,IAGJ;AACE,aACE,gCACG,wBAAc;AAAA,QACb;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC,GACH;AAAA,EAEN;AACF;AAEO,SAAS,aAAa;AAC3B,SAAO,OAAO;AAAA,IACZ,SAAS;AAAA,MACP,YAAY,KAAK;AAAA,QACf,OAAO;AAAA,MACT,CAAC;AAAA,MACD;AAAA,MACA;AAAA,MACA,iBAAiB,CAAC,YAAqB;AACrC,eAAO,MAAM,OAAO,OAAO,IAAI,QAAQ,OAAO;AAAA,MAChD;AAAA,IACF;AAAA,IACA,YAAY;AAAA,IACZ,eAAe,mBAAiB,WAAS;AACvC,aAAO,oBAAC,yBAAuB,GAAG,OAAO,eAA8B;AAAA,IACzE;AAAA,EACF,CAAC;AACH;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@makeswift/runtime",
|
|
3
|
-
"version": "0.28.10-canary.
|
|
3
|
+
"version": "0.28.10-canary.18",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "makeswift/makeswift",
|
|
@@ -244,9 +244,9 @@
|
|
|
244
244
|
"use-sync-external-store": "^1.5.0",
|
|
245
245
|
"uuid": "^9.0.0",
|
|
246
246
|
"zod": "^3.21.4",
|
|
247
|
-
"@makeswift/controls": "0.1.22-canary.
|
|
248
|
-
"@makeswift/
|
|
249
|
-
"@makeswift/
|
|
247
|
+
"@makeswift/controls": "0.1.22-canary.5",
|
|
248
|
+
"@makeswift/prop-controllers": "0.4.16-canary.5",
|
|
249
|
+
"@makeswift/next-plugin": "0.6.1"
|
|
250
250
|
},
|
|
251
251
|
"devDependencies": {
|
|
252
252
|
"@emotion/jest": "^11.11.0",
|