piral-solid 0.15.0-alpha.3809 → 0.15.0-alpha.3933

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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # [Piral Solid](https://piral.io) · [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-solid.svg?style=flat)](https://www.npmjs.com/package/piral-solid) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)
4
4
 
5
- This is a plugin that only has a peer dependency to `piral-core`. What `piral-solid` brings to the table is a set of Pilet API extensions that can be used with `piral` or `piral-core`.
5
+ This is a plugin that only has a peer dependency to `solid-js`. What `piral-solid` brings to the table is a set of Pilet API extensions that can be used with `piral` or `piral-core`.
6
6
 
7
7
  The set includes a Solid converter for any component registration, as well as a `fromSolid` shortcut and a `SolidExtension` component.
8
8
 
package/esm/converter.js CHANGED
@@ -3,17 +3,15 @@ import { createExtension } from './extension';
3
3
  export function createConverter(config = {}) {
4
4
  const { rootName = 'slot' } = config;
5
5
  const Extension = createExtension(rootName);
6
- const convert = (root) => {
7
- return {
8
- mount(el, props, context) {
9
- render(() => createComponent(root, Object.assign({ context }, props)), el);
10
- },
11
- unmount(el) {
12
- render(() => undefined, el);
13
- el.innerHTML = '';
14
- },
15
- };
16
- };
6
+ const convert = (root) => ({
7
+ mount(el, props, context) {
8
+ render(() => createComponent(root, Object.assign({ context }, props)), el);
9
+ },
10
+ unmount(el) {
11
+ render(() => undefined, el);
12
+ el.innerHTML = '';
13
+ },
14
+ });
17
15
  convert.Extension = Extension;
18
16
  return convert;
19
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"converter.js","sourceRoot":"","sources":["../src/converter.ts"],"names":[],"mappings":"AAEA,OA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,eAAe,CAAC,IAAI,kBAAI,OAAO,IAAK,KAAK,EAAG,EAAE,EAAE,CAAC,CAAC;QACjE,CAAC;QACD,OAAO,CAAC,EAAE;YACR,MAAM,CAAC,GAAG,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;YAC5B,EAAE,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,CAAC;KACF,CAAC,CAAC;IACH,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;IAC9B,OAAO,OAAO,CAAC;AACjB,CAAC"}
package/esm/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { ForeignComponent, ExtensionSlotProps } from 'piral-core';
2
- import { Component } from 'solid-js';
1
+ import type { ForeignComponent, ExtensionSlotProps } from 'piral-core';
2
+ import type { Component } from 'solid-js';
3
3
  declare module 'piral-core/lib/types/custom' {
4
4
  interface PiletCustomApi extends PiletSolidApi {
5
5
  }
package/lib/converter.js CHANGED
@@ -6,17 +6,15 @@ const extension_1 = require("./extension");
6
6
  function createConverter(config = {}) {
7
7
  const { rootName = 'slot' } = config;
8
8
  const Extension = (0, extension_1.createExtension)(rootName);
9
- const convert = (root) => {
10
- return {
11
- mount(el, props, context) {
12
- (0, dom_1.render)(() => (0, dom_1.createComponent)(root, Object.assign({ context }, props)), el);
13
- },
14
- unmount(el) {
15
- (0, dom_1.render)(() => undefined, el);
16
- el.innerHTML = '';
17
- },
18
- };
19
- };
9
+ const convert = (root) => ({
10
+ mount(el, props, context) {
11
+ (0, dom_1.render)(() => (0, dom_1.createComponent)(root, Object.assign({ context }, props)), el);
12
+ },
13
+ unmount(el) {
14
+ (0, dom_1.render)(() => undefined, el);
15
+ el.innerHTML = '';
16
+ },
17
+ });
20
18
  convert.Extension = Extension;
21
19
  return convert;
22
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"converter.js","sourceRoot":"","sources":["../src/converter.ts"],"names":[],"mappings":";;;AAEA,sCAAuD;AACvD,2CAA8C;AAU9C,SAAgB,eAAe,CAAC,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SAAS,EAAE,EAAE,CAAC,CAAC;YAC5B,EAAE,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,CAAC;KACF,CAAC,CAAC;IACH,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;IAC9B,OAAO,OAAO,CAAC;AACjB,CAAC;AAdD,0CAcC"}
package/lib/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { ForeignComponent, ExtensionSlotProps } from 'piral-core';
2
- import { Component } from 'solid-js';
1
+ import type { ForeignComponent, ExtensionSlotProps } from 'piral-core';
2
+ import type { Component } from 'solid-js';
3
3
  declare module 'piral-core/lib/types/custom' {
4
4
  interface PiletCustomApi extends PiletSolidApi {
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "piral-solid",
3
- "version": "0.15.0-alpha.3809",
3
+ "version": "0.15.0-alpha.3933",
4
4
  "description": "Plugin for integrating Solid components in Piral.",
5
5
  "keywords": [
6
6
  "piral",
@@ -44,12 +44,11 @@
44
44
  "test": "echo \"Error: run tests from root\" && exit 1"
45
45
  },
46
46
  "devDependencies": {
47
- "piral-core": "0.15.0-alpha.3809",
47
+ "piral-core": "0.15.0-alpha.3933",
48
48
  "solid-js": "^0.18.7"
49
49
  },
50
50
  "peerDependencies": {
51
- "piral-core": "0.14.x",
52
51
  "solid-js": "^0.18.0"
53
52
  },
54
- "gitHead": "e26067cdcbbe90ff72d1d0815929655c05126e3a"
53
+ "gitHead": "520a272d09f02543153f1d8b2ae23a3ae10acd6f"
55
54
  }
package/src/converter.ts CHANGED
@@ -14,17 +14,15 @@ export interface SolidConverterOptions {
14
14
  export function createConverter(config: SolidConverterOptions = {}) {
15
15
  const { rootName = 'slot' } = config;
16
16
  const Extension = createExtension(rootName);
17
- const convert = <TProps extends BaseComponentProps>(root: Component<TProps>): ForeignComponent<TProps> => {
18
- return {
19
- mount(el, props, context) {
20
- render(() => createComponent(root, { context, ...props }), el);
21
- },
22
- unmount(el) {
23
- render(() => undefined, el);
24
- el.innerHTML = '';
25
- },
26
- };
27
- };
17
+ const convert = <TProps extends BaseComponentProps>(root: Component<TProps>): ForeignComponent<TProps> => ({
18
+ mount(el, props, context) {
19
+ render(() => createComponent(root, { context, ...props }), el);
20
+ },
21
+ unmount(el) {
22
+ render(() => undefined, el);
23
+ el.innerHTML = '';
24
+ },
25
+ });
28
26
  convert.Extension = Extension;
29
27
  return convert;
30
28
  }
package/src/types.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { ForeignComponent, ExtensionSlotProps } from 'piral-core';
2
- import { Component } from 'solid-js';
1
+ import type { ForeignComponent, ExtensionSlotProps } from 'piral-core';
2
+ import type { Component } from 'solid-js';
3
3
 
4
4
  declare module 'piral-core/lib/types/custom' {
5
5
  interface PiletCustomApi extends PiletSolidApi {}