@ni/spright-react 0.4.5 → 0.5.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.
@@ -1,2 +1,2 @@
1
1
  import { ChatConversation } from '@ni/spright-components/dist/esm/chat/conversation';
2
- export declare const SprightChatConversation: import("@ni/fast-react-wrapper").ReactWrapper<ChatConversation, unknown>;
2
+ export declare const SprightChatConversation: import("@lit/react").ReactWebComponent<ChatConversation, {}>;
@@ -1,8 +1,9 @@
1
1
  import { ChatInput } from '@ni/spright-components/dist/esm/chat/input';
2
2
  import type { ChatInputSendEventDetail } from '@ni/spright-components/dist/esm/chat/input/types';
3
+ import { type EventName } from '../../utilities/react-wrapper';
3
4
  export { type ChatInput };
4
- export declare const SprightChatInput: import("@ni/fast-react-wrapper").ReactWrapper<ChatInput, {
5
- onSend: unknown;
5
+ export declare const SprightChatInput: import("@lit/react").ReactWebComponent<ChatInput, {
6
+ onSend: EventName<ChatInputSendEvent>;
6
7
  }>;
7
8
  export interface ChatInputSendEvent extends CustomEvent<ChatInputSendEventDetail> {
8
9
  target: ChatInput;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/chat/input/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,4CAA4C,CAAC;AAEvE,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAErD,OAAO,EAAkB,CAAC;AAC1B,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC,SAAS,EAAE;IAC5C,MAAM,EAAE;QACJ,MAAM,EAAE,MAAM;KACjB;CACJ,CAAC,CAAC","sourcesContent":["import { ChatInput } from '@ni/spright-components/dist/esm/chat/input';\nimport type { ChatInputSendEventDetail } from '@ni/spright-components/dist/esm/chat/input/types';\nimport { wrap } from '../../utilities/react-wrapper';\n\nexport { type ChatInput };\nexport const SprightChatInput = wrap(ChatInput, {\n events: {\n onSend: 'send',\n }\n});\nexport interface ChatInputSendEvent extends CustomEvent<ChatInputSendEventDetail> {\n target: ChatInput;\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/chat/input/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,4CAA4C,CAAC;AAEvE,OAAO,EAAE,IAAI,EAAkB,MAAM,+BAA+B,CAAC;AAErE,OAAO,EAAkB,CAAC;AAC1B,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC,SAAS,EAAE;IAC5C,MAAM,EAAE;QACJ,MAAM,EAAE,MAAuC;KAClD;CACJ,CAAC,CAAC","sourcesContent":["import { ChatInput } from '@ni/spright-components/dist/esm/chat/input';\nimport type { ChatInputSendEventDetail } from '@ni/spright-components/dist/esm/chat/input/types';\nimport { wrap, type EventName } from '../../utilities/react-wrapper';\n\nexport { type ChatInput };\nexport const SprightChatInput = wrap(ChatInput, {\n events: {\n onSend: 'send' as EventName<ChatInputSendEvent>,\n }\n});\nexport interface ChatInputSendEvent extends CustomEvent<ChatInputSendEventDetail> {\n target: ChatInput;\n}\n"]}
@@ -1,2 +1,2 @@
1
1
  import { ChatMessage } from '@ni/spright-components/dist/esm/chat/message';
2
- export declare const SprightChatMessage: import("@ni/fast-react-wrapper").ReactWrapper<ChatMessage, unknown>;
2
+ export declare const SprightChatMessage: import("@lit/react").ReactWebComponent<ChatMessage, {}>;
@@ -1,2 +1,2 @@
1
1
  import { Rectangle } from '@ni/spright-components/dist/esm/rectangle';
2
- export declare const SprightRectangle: import("@ni/fast-react-wrapper").ReactWrapper<Rectangle, unknown>;
2
+ export declare const SprightRectangle: import("@lit/react").ReactWebComponent<Rectangle, {}>;
@@ -1,4 +1,8 @@
1
- export declare const wrap: {
2
- <TRegistry extends import("@ni/fast-foundation").FoundationElementRegistry<import("@ni/fast-foundation").FoundationElementDefinition, any>, TEvents>(registry: TRegistry, config?: import("@ni/fast-react-wrapper").ReactWrapperConfig<TEvents> | undefined): import("@ni/fast-react-wrapper").ReactWrapper<import("@ni/fast-react-wrapper").FoundationElementRegistryElement<TRegistry>, TEvents>;
3
- <TElement extends HTMLElement, TEvents_1>(type: import("@ni/fast-element").Constructable<TElement>, config?: import("@ni/fast-react-wrapper").ReactWrapperConfig<TEvents_1> | undefined): import("@ni/fast-react-wrapper").ReactWrapper<TElement, TEvents_1>;
4
- };
1
+ import type { EventName, Options, ReactWebComponent } from '@lit/react';
2
+ export { type EventName } from '@lit/react';
3
+ export interface EventNames {
4
+ [key: string]: EventName | string;
5
+ }
6
+ type Constructor<T> = new () => T;
7
+ type Opts<I extends HTMLElement, E extends EventNames = NonNullable<unknown>> = Omit<Options<I, E>, 'elementClass' | 'react' | 'tagName'>;
8
+ export declare function wrap<I extends HTMLElement, E extends EventNames = NonNullable<unknown>>(elementClass: Constructor<I>, options?: Opts<I, E>): ReactWebComponent<I, E>;
@@ -1,4 +1,12 @@
1
- import * as React from 'react';
2
- import { provideReactWrapper } from '@ni/fast-react-wrapper';
3
- export const { wrap } = provideReactWrapper(React);
1
+ import { createComponent } from '@lit/react';
2
+ import React from 'react';
3
+ export {} from '@lit/react';
4
+ export function wrap(elementClass, options = {}) {
5
+ return createComponent({
6
+ ...options,
7
+ elementClass,
8
+ react: React,
9
+ tagName: customElements.getName(elementClass)
10
+ });
11
+ }
4
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utilities/react-wrapper/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { provideReactWrapper } from '@ni/fast-react-wrapper';\n\nexport const { wrap } = provideReactWrapper(React);\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utilities/react-wrapper/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAkB,MAAM,YAAY,CAAC;AAW5C,MAAM,UAAU,IAAI,CAChB,YAA4B,EAC5B,UAAsB,EAAE;IAExB,OAAO,eAAe,CAAO;QACzB,GAAG,OAAO;QACV,YAAY;QACZ,KAAK,EAAE,KAAK;QACZ,OAAO,EAAE,cAAc,CAAC,OAAO,CAAC,YAAY,CAAE;KACjD,CAAC,CAAC;AACP,CAAC","sourcesContent":["import type { EventName, Options, ReactWebComponent } from '@lit/react';\nimport { createComponent } from '@lit/react';\nimport React from 'react';\n\nexport { type EventName } from '@lit/react';\nexport interface EventNames {\n [key: string]: EventName | string;\n}\n\ntype Constructor<T> = new () => T;\ntype Opts<\n I extends HTMLElement,\n E extends EventNames = NonNullable<unknown>\n> = Omit<Options<I, E>, 'elementClass' | 'react' | 'tagName'>;\n\nexport function wrap<I extends HTMLElement, E extends EventNames = NonNullable<unknown>>(\n elementClass: Constructor<I>,\n options: Opts<I, E> = {},\n): ReactWebComponent<I, E> {\n return createComponent<I, E>({\n ...options,\n elementClass,\n react: React,\n tagName: customElements.getName(elementClass)!\n });\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ni/spright-react",
3
- "version": "0.4.5",
3
+ "version": "0.5.0",
4
4
  "description": "React components for NI Spright",
5
5
  "keywords": [
6
6
  "spright",
@@ -28,7 +28,7 @@
28
28
  "typescript": "~5.4.5"
29
29
  },
30
30
  "peerDependencies": {
31
- "@ni/fast-react-wrapper": "^10.1.2",
31
+ "@lit/react": "^1.0.8",
32
32
  "@ni/spright-components": "^6.3.3",
33
33
  "react": "^16 || ^17 || ^18"
34
34
  }