@brftech/filex-react 0.1.56 → 0.1.60

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 CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 BRF Tech
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.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 BRF Tech
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.
@@ -1 +1 @@
1
- {"version":3,"file":"filex-react.cjs","sources":["../src/index.ts"],"sourcesContent":["/**\r\n * @brftech/filex-react — React adapter around the `<filex-explorer>`\r\n * Web Component.\r\n *\r\n * Uses `@lit/react`'s `createComponent` to map element attributes /\r\n * properties / events into idiomatic React props (camelCased event\r\n * handlers like `onError`, real prop assignment for the `config`\r\n * object, no need to imperatively reach for `.addEventListener`).\r\n *\r\n * Side-effect: importing this module also imports `@brftech/filex`\r\n * which registers the underlying custom element.\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { createComponent } from '@lit/react';\r\nimport '@brftech/filex'; // side-effect: registers `<filex-explorer>`\r\nimport type { ExplorerConfig } from '@brftech/filex';\r\n\r\n/**\r\n * Resolve the registered class. We do this lazily inside a getter so\r\n * tree-shaking-time evaluation in some bundlers doesn't trip the\r\n * `customElements.get(…)` lookup before the side-effect import has run\r\n * (it has, but TS analysers can be jumpy). At runtime this evaluates\r\n * once at module load.\r\n */\r\nconst FilexElementClass =\r\n (typeof customElements !== 'undefined' && customElements.get('filex-explorer')) ||\r\n // Fallback for SSR — the element class is irrelevant on the server\r\n // because createComponent only renders the tag string. Provide an\r\n // empty class shim so types resolve.\r\n (class {} as unknown as CustomElementConstructor);\r\n\r\n/**\r\n * Idiomatic React component — used like a normal JSX tag with native\r\n * props.\r\n *\r\n * <FileManager\r\n * config={{ apiBase: 'https://files.example.com',\r\n * auth: { kind: 'bearer', token } }}\r\n * onError={(e) => console.error(e.detail)}\r\n * />\r\n */\r\nexport const FileManager = createComponent({\r\n react: React,\r\n tagName: 'filex-explorer',\r\n elementClass: FilexElementClass,\r\n events: {\r\n onError: 'error',\r\n onShareCreated: 'share-created',\r\n onFileOpened: 'file-opened',\r\n onUploadProgress: 'upload-progress',\r\n onSelectionChange: 'selection-change',\r\n },\r\n});\r\n\r\n/**\r\n * Re-export the config types so React consumers don't need a second\r\n * dependency on `@brftech/filex-core` just to type the `config` prop.\r\n */\r\nexport type {\r\n ExplorerConfig,\r\n AuthConfig,\r\n ThemeMode,\r\n LocaleCode,\r\n FileNode,\r\n ShareInfo,\r\n Capabilities,\r\n UploadInitResponse,\r\n UploadFinalizeResponse,\r\n ArchiveEntry,\r\n ViewMode,\r\n} from '@brftech/filex-core';\r\n\r\n/**\r\n * Helper-typed payloads the events carry — matches the SFC's emit\r\n * declarations so consumers get autocomplete on `event.detail`.\r\n */\r\nexport interface FilexErrorDetail {\r\n message: string;\r\n context?: unknown;\r\n}\r\n\r\nexport interface FilexShareCreatedDetail {\r\n path: string;\r\n url: string;\r\n pin: string | null;\r\n}\r\n\r\nexport interface FilexFileOpenedDetail {\r\n path: string;\r\n basename: string;\r\n}\r\n\r\nexport interface FilexUploadProgressDetail {\r\n uploadId: string;\r\n percent: number;\r\n done: boolean;\r\n}\r\n\r\nexport type FilexSelectionChangeDetail = Array<{\r\n path: string;\r\n basename: string;\r\n type: 'file' | 'dir';\r\n}>;\r\n"],"names":["FilexElementClass","FileManager","createComponent","React"],"mappings":"qbAyBMA,EACH,OAAO,eAAmB,KAAe,eAAe,IAAI,gBAAgB,GAI5E,KAAM,CAAC,EAYGC,EAAcC,EAAAA,gBAAgB,CACzC,MAAOC,EACP,QAAS,iBACT,aAAcH,EACd,OAAQ,CACN,QAAS,QACT,eAAgB,gBAChB,aAAc,cACd,iBAAkB,kBAClB,kBAAmB,kBAAA,CAEvB,CAAC"}
1
+ {"version":3,"file":"filex-react.cjs","sources":["../src/index.ts"],"sourcesContent":["/**\n * @brftech/filex-react — React adapter around the `<filex-explorer>`\n * Web Component.\n *\n * Uses `@lit/react`'s `createComponent` to map element attributes /\n * properties / events into idiomatic React props (camelCased event\n * handlers like `onError`, real prop assignment for the `config`\n * object, no need to imperatively reach for `.addEventListener`).\n *\n * Side-effect: importing this module also imports `@brftech/filex`\n * which registers the underlying custom element.\n */\n\nimport * as React from 'react';\nimport { createComponent } from '@lit/react';\nimport '@brftech/filex'; // side-effect: registers `<filex-explorer>`\nimport type { ExplorerConfig } from '@brftech/filex';\n\n/**\n * Resolve the registered class. We do this lazily inside a getter so\n * tree-shaking-time evaluation in some bundlers doesn't trip the\n * `customElements.get(…)` lookup before the side-effect import has run\n * (it has, but TS analysers can be jumpy). At runtime this evaluates\n * once at module load.\n */\nconst FilexElementClass =\n (typeof customElements !== 'undefined' && customElements.get('filex-explorer')) ||\n // Fallback for SSR — the element class is irrelevant on the server\n // because createComponent only renders the tag string. Provide an\n // empty class shim so types resolve.\n (class {} as unknown as CustomElementConstructor);\n\n/**\n * Idiomatic React component — used like a normal JSX tag with native\n * props.\n *\n * <FileManager\n * config={{ apiBase: 'https://files.example.com',\n * auth: { kind: 'bearer', token } }}\n * onError={(e) => console.error(e.detail)}\n * />\n */\nexport const FileManager = createComponent({\n react: React,\n tagName: 'filex-explorer',\n elementClass: FilexElementClass,\n events: {\n onError: 'error',\n onShareCreated: 'share-created',\n onFileOpened: 'file-opened',\n onUploadProgress: 'upload-progress',\n onSelectionChange: 'selection-change',\n },\n});\n\n/**\n * Re-export the config types so React consumers don't need a second\n * dependency on `@brftech/filex-core` just to type the `config` prop.\n */\nexport type {\n ExplorerConfig,\n AuthConfig,\n ThemeMode,\n LocaleCode,\n FileNode,\n ShareInfo,\n Capabilities,\n UploadInitResponse,\n UploadFinalizeResponse,\n ArchiveEntry,\n ViewMode,\n} from '@brftech/filex-core';\n\n/**\n * Helper-typed payloads the events carry — matches the SFC's emit\n * declarations so consumers get autocomplete on `event.detail`.\n */\nexport interface FilexErrorDetail {\n message: string;\n context?: unknown;\n}\n\nexport interface FilexShareCreatedDetail {\n path: string;\n url: string;\n pin: string | null;\n}\n\nexport interface FilexFileOpenedDetail {\n path: string;\n basename: string;\n}\n\nexport interface FilexUploadProgressDetail {\n uploadId: string;\n percent: number;\n done: boolean;\n}\n\nexport type FilexSelectionChangeDetail = Array<{\n path: string;\n basename: string;\n type: 'file' | 'dir';\n}>;\n"],"names":["FilexElementClass","FileManager","createComponent","React"],"mappings":"qbAyBMA,EACH,OAAO,eAAmB,KAAe,eAAe,IAAI,gBAAgB,GAI5E,KAAM,CAAC,EAYGC,EAAcC,EAAAA,gBAAgB,CACzC,MAAOC,EACP,QAAS,iBACT,aAAcH,EACd,OAAQ,CACN,QAAS,QACT,eAAgB,gBAChB,aAAc,cACd,iBAAkB,kBAClB,kBAAmB,kBAAA,CAEvB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"filex-react.js","sources":["../src/index.ts"],"sourcesContent":["/**\r\n * @brftech/filex-react — React adapter around the `<filex-explorer>`\r\n * Web Component.\r\n *\r\n * Uses `@lit/react`'s `createComponent` to map element attributes /\r\n * properties / events into idiomatic React props (camelCased event\r\n * handlers like `onError`, real prop assignment for the `config`\r\n * object, no need to imperatively reach for `.addEventListener`).\r\n *\r\n * Side-effect: importing this module also imports `@brftech/filex`\r\n * which registers the underlying custom element.\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { createComponent } from '@lit/react';\r\nimport '@brftech/filex'; // side-effect: registers `<filex-explorer>`\r\nimport type { ExplorerConfig } from '@brftech/filex';\r\n\r\n/**\r\n * Resolve the registered class. We do this lazily inside a getter so\r\n * tree-shaking-time evaluation in some bundlers doesn't trip the\r\n * `customElements.get(…)` lookup before the side-effect import has run\r\n * (it has, but TS analysers can be jumpy). At runtime this evaluates\r\n * once at module load.\r\n */\r\nconst FilexElementClass =\r\n (typeof customElements !== 'undefined' && customElements.get('filex-explorer')) ||\r\n // Fallback for SSR — the element class is irrelevant on the server\r\n // because createComponent only renders the tag string. Provide an\r\n // empty class shim so types resolve.\r\n (class {} as unknown as CustomElementConstructor);\r\n\r\n/**\r\n * Idiomatic React component — used like a normal JSX tag with native\r\n * props.\r\n *\r\n * <FileManager\r\n * config={{ apiBase: 'https://files.example.com',\r\n * auth: { kind: 'bearer', token } }}\r\n * onError={(e) => console.error(e.detail)}\r\n * />\r\n */\r\nexport const FileManager = createComponent({\r\n react: React,\r\n tagName: 'filex-explorer',\r\n elementClass: FilexElementClass,\r\n events: {\r\n onError: 'error',\r\n onShareCreated: 'share-created',\r\n onFileOpened: 'file-opened',\r\n onUploadProgress: 'upload-progress',\r\n onSelectionChange: 'selection-change',\r\n },\r\n});\r\n\r\n/**\r\n * Re-export the config types so React consumers don't need a second\r\n * dependency on `@brftech/filex-core` just to type the `config` prop.\r\n */\r\nexport type {\r\n ExplorerConfig,\r\n AuthConfig,\r\n ThemeMode,\r\n LocaleCode,\r\n FileNode,\r\n ShareInfo,\r\n Capabilities,\r\n UploadInitResponse,\r\n UploadFinalizeResponse,\r\n ArchiveEntry,\r\n ViewMode,\r\n} from '@brftech/filex-core';\r\n\r\n/**\r\n * Helper-typed payloads the events carry — matches the SFC's emit\r\n * declarations so consumers get autocomplete on `event.detail`.\r\n */\r\nexport interface FilexErrorDetail {\r\n message: string;\r\n context?: unknown;\r\n}\r\n\r\nexport interface FilexShareCreatedDetail {\r\n path: string;\r\n url: string;\r\n pin: string | null;\r\n}\r\n\r\nexport interface FilexFileOpenedDetail {\r\n path: string;\r\n basename: string;\r\n}\r\n\r\nexport interface FilexUploadProgressDetail {\r\n uploadId: string;\r\n percent: number;\r\n done: boolean;\r\n}\r\n\r\nexport type FilexSelectionChangeDetail = Array<{\r\n path: string;\r\n basename: string;\r\n type: 'file' | 'dir';\r\n}>;\r\n"],"names":["FilexElementClass","FileManager","createComponent","React"],"mappings":";;;AAyBA,MAAMA,IACH,OAAO,iBAAmB,OAAe,eAAe,IAAI,gBAAgB;AAAA;AAAA;AAI5E,MAAM;AAAC,GAYGC,IAAcC,EAAgB;AAAA,EACzC,OAAOC;AAAA,EACP,SAAS;AAAA,EACT,cAAcH;AAAA,EACd,QAAQ;AAAA,IACN,SAAS;AAAA,IACT,gBAAgB;AAAA,IAChB,cAAc;AAAA,IACd,kBAAkB;AAAA,IAClB,mBAAmB;AAAA,EAAA;AAEvB,CAAC;"}
1
+ {"version":3,"file":"filex-react.js","sources":["../src/index.ts"],"sourcesContent":["/**\n * @brftech/filex-react — React adapter around the `<filex-explorer>`\n * Web Component.\n *\n * Uses `@lit/react`'s `createComponent` to map element attributes /\n * properties / events into idiomatic React props (camelCased event\n * handlers like `onError`, real prop assignment for the `config`\n * object, no need to imperatively reach for `.addEventListener`).\n *\n * Side-effect: importing this module also imports `@brftech/filex`\n * which registers the underlying custom element.\n */\n\nimport * as React from 'react';\nimport { createComponent } from '@lit/react';\nimport '@brftech/filex'; // side-effect: registers `<filex-explorer>`\nimport type { ExplorerConfig } from '@brftech/filex';\n\n/**\n * Resolve the registered class. We do this lazily inside a getter so\n * tree-shaking-time evaluation in some bundlers doesn't trip the\n * `customElements.get(…)` lookup before the side-effect import has run\n * (it has, but TS analysers can be jumpy). At runtime this evaluates\n * once at module load.\n */\nconst FilexElementClass =\n (typeof customElements !== 'undefined' && customElements.get('filex-explorer')) ||\n // Fallback for SSR — the element class is irrelevant on the server\n // because createComponent only renders the tag string. Provide an\n // empty class shim so types resolve.\n (class {} as unknown as CustomElementConstructor);\n\n/**\n * Idiomatic React component — used like a normal JSX tag with native\n * props.\n *\n * <FileManager\n * config={{ apiBase: 'https://files.example.com',\n * auth: { kind: 'bearer', token } }}\n * onError={(e) => console.error(e.detail)}\n * />\n */\nexport const FileManager = createComponent({\n react: React,\n tagName: 'filex-explorer',\n elementClass: FilexElementClass,\n events: {\n onError: 'error',\n onShareCreated: 'share-created',\n onFileOpened: 'file-opened',\n onUploadProgress: 'upload-progress',\n onSelectionChange: 'selection-change',\n },\n});\n\n/**\n * Re-export the config types so React consumers don't need a second\n * dependency on `@brftech/filex-core` just to type the `config` prop.\n */\nexport type {\n ExplorerConfig,\n AuthConfig,\n ThemeMode,\n LocaleCode,\n FileNode,\n ShareInfo,\n Capabilities,\n UploadInitResponse,\n UploadFinalizeResponse,\n ArchiveEntry,\n ViewMode,\n} from '@brftech/filex-core';\n\n/**\n * Helper-typed payloads the events carry — matches the SFC's emit\n * declarations so consumers get autocomplete on `event.detail`.\n */\nexport interface FilexErrorDetail {\n message: string;\n context?: unknown;\n}\n\nexport interface FilexShareCreatedDetail {\n path: string;\n url: string;\n pin: string | null;\n}\n\nexport interface FilexFileOpenedDetail {\n path: string;\n basename: string;\n}\n\nexport interface FilexUploadProgressDetail {\n uploadId: string;\n percent: number;\n done: boolean;\n}\n\nexport type FilexSelectionChangeDetail = Array<{\n path: string;\n basename: string;\n type: 'file' | 'dir';\n}>;\n"],"names":["FilexElementClass","FileManager","createComponent","React"],"mappings":";;;AAyBA,MAAMA,IACH,OAAO,iBAAmB,OAAe,eAAe,IAAI,gBAAgB;AAAA;AAAA;AAI5E,MAAM;AAAC,GAYGC,IAAcC,EAAgB;AAAA,EACzC,OAAOC;AAAA,EACP,SAAS;AAAA,EACT,cAAcH;AAAA,EACd,QAAQ;AAAA,IACN,SAAS;AAAA,IACT,gBAAgB;AAAA,IAChB,cAAc;AAAA,IACd,kBAAkB;AAAA,IAClB,mBAAmB;AAAA,EAAA;AAEvB,CAAC;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brftech/filex-react",
3
- "version": "0.1.56",
3
+ "version": "0.1.60",
4
4
  "description": "filex React adapter — wraps <filex-explorer> for React idiom (props + camelCase event handlers)",
5
5
  "type": "module",
6
6
  "main": "./dist/filex-react.cjs",
@@ -19,8 +19,8 @@
19
19
  ],
20
20
  "dependencies": {
21
21
  "@lit/react": "^1.0.5",
22
- "@brftech/filex": "0.1.56",
23
- "@brftech/filex-core": "0.1.56"
22
+ "@brftech/filex": "0.1.60",
23
+ "@brftech/filex-core": "0.1.60"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "react": "^18.0.0 || ^19.0.0",