@nu-art/ts-short-url-frontend 0.401.9 → 0.500.6

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,13 +1,12 @@
1
1
  import './ATS_ShortUrl.scss';
2
- import { AppToolsScreen, ComponentSync } from '@nu-art/thunderstorm-frontend/index';
3
- import { DispatcherType_ShortUrl } from '../../_entity/short-url/index.js';
4
- import { ApiCallerEventType, DispatcherInterface } from '@nu-art/thunderstorm-frontend/core/db-api-gen/types';
5
- import { DBProto_ShortUrl } from '@nu-art/ts-short-url-shared';
2
+ import { AppToolsScreen } from '@nu-art/thunder-ui-modules';
3
+ import { ComponentSync } from '@nu-art/thunder-widgets';
4
+ import { DispatcherInterface } from '@nu-art/db-api-shared';
6
5
  type State = {};
7
6
  type Props = {};
8
- export declare class ATS_ShortUrl extends ComponentSync<Props, State> implements DispatcherInterface<DispatcherType_ShortUrl> {
7
+ export declare class ATS_ShortUrl extends ComponentSync<Props, State> implements DispatcherInterface<any> {
9
8
  static screen: AppToolsScreen;
10
- __onShortUrlsUpdated(...params: ApiCallerEventType<DBProto_ShortUrl>): void;
9
+ __onShortUrlsUpdated(...params: any): void;
11
10
  render(): import("react/jsx-runtime").JSX.Element;
12
11
  }
13
12
  export {};
@@ -1,10 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import './ATS_ShortUrl.scss';
3
- import { ATS_Fullstack, Button, ComponentSync, LL_H_C, LL_V_L, TS_AppTools } from '@nu-art/thunderstorm-frontend/index';
4
- import { ModuleFE_ShortUrl } from '../../_entity/short-url/index.js';
3
+ import { TS_EditableItemController } from '@nu-art/editable-item';
4
+ import { ATS_Fullstack, TS_AppTools } from '@nu-art/thunder-ui-modules';
5
+ import { Button, ComponentSync, LL_H_C, LL_V_L } from '@nu-art/thunder-widgets';
6
+ import { ModuleFE_ShortUrl } from '../../_entity/short-url/ModuleFE_ShortUrl.js';
5
7
  import { Component_ShortUrlEditor } from './components/Component_ShortUrlEditor.js';
6
8
  import { sortArray, voidFunction } from '@nu-art/ts-common';
7
- import { TS_EditableItemController } from '@nu-art/thunderstorm-frontend/components/TS_EditableItemController/index';
8
9
  export class ATS_ShortUrl extends ComponentSync {
9
10
  static screen = {
10
11
  name: 'Short Url',
@@ -1,12 +1,13 @@
1
1
  import './Component_ShortUrlEditor.scss';
2
- import { EditableRef, TS_EditableContent } from '@nu-art/thunderstorm-frontend/editable-item';
3
- import { InferProps, InferState } from '@nu-art/thunderstorm-frontend/index';
4
- import { DBProto_ShortUrl, UI_ShortUrl } from '@nu-art/ts-short-url-shared';
2
+ import type { EditableRef } from '@nu-art/editable-item';
3
+ import { TS_EditableContent } from '@nu-art/editable-item';
4
+ import { InferProps, InferState } from '@nu-art/thunder-widgets';
5
+ import { DatabaseDef_ShortUrl, UI_ShortUrl } from '@nu-art/ts-short-url-shared';
5
6
  type Props = EditableRef<UI_ShortUrl> & {
6
7
  deleteCallback?: VoidFunction;
7
8
  };
8
9
  type State = EditableRef<UI_ShortUrl>;
9
- export declare class Component_ShortUrlEditor extends TS_EditableContent<DBProto_ShortUrl, Props, State> {
10
+ export declare class Component_ShortUrlEditor extends TS_EditableContent<DatabaseDef_ShortUrl, Props, State> {
10
11
  protected deriveStateFromProps(nextProps: InferProps<this>, state: InferState<this>): InferState<this>;
11
12
  render(): import("react/jsx-runtime").JSX.Element;
12
13
  }
@@ -1,16 +1,14 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import './Component_ShortUrlEditor.scss';
3
- import { TS_EditableContent, TS_EditableItemStatus } from '@nu-art/thunderstorm-frontend/editable-item';
4
- import { Button, LL_H_C, ModuleFE_Thunderstorm, TS_Card, TS_PropRenderer } from '@nu-art/thunderstorm-frontend/index';
5
- import { TS_InputV2 } from '@nu-art/thunderstorm-frontend/components/TS_V2_Input/index';
3
+ import { EDITABLE, TS_EditableContent, TS_EditableItemStatus } from '@nu-art/editable-item';
4
+ import { Button, LL_H_C, TS_PropRenderer } from '@nu-art/thunder-widgets';
6
5
  import { TS_Icons } from '@nu-art/ts-styles';
7
- import { TS_TextAreaV2 } from '@nu-art/thunderstorm-frontend/components/TS_V2_TextArea/index';
8
- import { ModuleFE_ShortUrl } from '../../../_entity/short-url/index.js';
9
- const StringEditableInput = TS_InputV2.editable({
6
+ import { ModuleFE_ShortUrl } from '../../../_entity/short-url/ModuleFE_ShortUrl.js';
7
+ const StringEditableInput = EDITABLE.Input.editable({
10
8
  type: 'text',
11
9
  saveEvent: ['blur', 'accept']
12
10
  });
13
- const TextArea = TS_TextAreaV2.editable({
11
+ const TextArea = EDITABLE.TextArea({
14
12
  saveEvent: ['blur', 'accept']
15
13
  });
16
14
  export class Component_ShortUrlEditor extends TS_EditableContent {
@@ -20,7 +18,7 @@ export class Component_ShortUrlEditor extends TS_EditableContent {
20
18
  }
21
19
  render() {
22
20
  const _id = this.state.editable.get('_id');
23
- return _jsxs(TS_Card, { className: 'short-url-editor', children: [_jsxs(LL_H_C, { className: 'utils', children: [_jsx(TS_EditableItemStatus, { editable: this.state.editable }), _jsx(TS_Icons.x.component, { onClick: async () => {
21
+ return _jsxs("div", { className: 'short-url-editor', children: [_jsxs(LL_H_C, { className: 'utils', children: [_jsx(TS_EditableItemStatus, { editable: this.state.editable }), _jsx(TS_Icons.x.component, { onClick: async () => {
24
22
  if (this.state.editable.get('_id'))
25
23
  await this.state.editable.delete();
26
24
  this.props.deleteCallback?.();
@@ -28,17 +26,17 @@ export class Component_ShortUrlEditor extends TS_EditableContent {
28
26
  if (value.length)
29
27
  return this.state.editable.updateObj({ title: value });
30
28
  return this.state.editable.updateObj({ title: undefined });
31
- } }) }), _jsx(TS_PropRenderer.Vertical, { label: 'Short Url', children: _jsx("div", { children: this.state.editable.item._shortUrl }) })] }), _jsx(TS_PropRenderer.Vertical, { label: 'Full Url', children: _jsx(TextArea, { editable: this.state.editable, prop: 'fullUrl', className: 'url-input', onChange: value => {
29
+ } }) }), _jsx(TS_PropRenderer.Vertical, { label: 'Short Url', children: _jsx("div", { children: this.state.editable.item._shortUrl }) })] }), _jsx(TS_PropRenderer.Vertical, { label: 'Full Url', children: _jsx(TextArea, { editable: this.state.editable, prop: 'fullUrl', className: 'url-input', onChange: (value) => {
32
30
  if (value.length)
33
31
  return this.state.editable.updateObj({ fullUrl: value });
34
32
  return this.state.editable.updateObj({ fullUrl: undefined });
35
- } }) }), _jsx(TS_PropRenderer.Vertical, { label: 'Description', children: _jsx(TextArea, { editable: this.state.editable, prop: 'description', onChange: value => {
33
+ } }) }), _jsx(TS_PropRenderer.Vertical, { label: 'Description', children: _jsx(TextArea, { editable: this.state.editable, prop: 'description', onChange: (value) => {
36
34
  if (value?.length)
37
35
  return this.state.editable.updateObj({ description: value });
38
36
  return this.state.editable.updateObj({ description: undefined });
39
37
  } }) }), _jsxs(LL_H_C, { className: 'buttons-container', children: [_jsx(Button, { variant: 'tertiary', disabled: !_id, onClick: async () => {
40
- const { shortUrl } = await ModuleFE_ShortUrl._v1.getShortUrl({ _id: _id }).executeSync();
41
- await ModuleFE_Thunderstorm.copyToClipboard(shortUrl);
38
+ const { shortUrl } = await ModuleFE_ShortUrl.getShortUrl({ _id: _id });
39
+ await navigator.clipboard.writeText(shortUrl);
42
40
  }, children: "Copy ShortUrl To Clipboard" }), _jsx(Button, { variant: 'primary', onClick: async () => {
43
41
  await this.state.editable.save();
44
42
  }, children: "Save" })] })] });
@@ -1,11 +1,11 @@
1
- import { ApiStruct_ShortUrl, DBProto_ShortUrl } from '@nu-art/ts-short-url-shared';
2
- import { DispatcherDef, ThunderDispatcherV3 } from '@nu-art/thunderstorm-frontend/core/db-api-gen/types';
3
- import { ModuleFE_BaseApi } from '@nu-art/thunderstorm-frontend/index';
4
- import { ApiDefCaller } from '@nu-art/thunderstorm-shared';
5
- export type DispatcherType_ShortUrl = DispatcherDef<DBProto_ShortUrl, `__onShortUrlsUpdated`>;
6
- export declare const dispatch_onShortUrlsUpdated: ThunderDispatcherV3<DispatcherType_ShortUrl>;
7
- export declare class ModuleFE_ShortUrl_Class extends ModuleFE_BaseApi<DBProto_ShortUrl> implements ApiDefCaller<ApiStruct_ShortUrl> {
8
- _v1: ApiDefCaller<ApiStruct_ShortUrl>['_v1'];
1
+ import { API_ShortUrl, DatabaseDef_ShortUrl } from '@nu-art/ts-short-url-shared';
2
+ import { EventDispatcher, ModuleFE_BaseApi } from '@nu-art/db-api-frontend';
3
+ export type DispatcherType_ShortUrl = `__onShortUrlsUpdated`;
4
+ export declare const dispatch_onShortUrlsUpdated: EventDispatcher<import("@nu-art/ts-short-url-shared").DB_ShortUrl> & {
5
+ addListener(fn: EventDispatcher<DatabaseDef_ShortUrl["dbType"]>): void;
6
+ };
7
+ export declare class ModuleFE_ShortUrl_Class extends ModuleFE_BaseApi<DatabaseDef_ShortUrl> {
9
8
  constructor();
9
+ getShortUrl(params: API_ShortUrl['getShortUrl']['Params']): Promise<API_ShortUrl['getShortUrl']['Response']>;
10
10
  }
11
11
  export declare const ModuleFE_ShortUrl: ModuleFE_ShortUrl_Class;
@@ -1,14 +1,77 @@
1
- import { ApiDef_ShortUrl, DBDef_ShortUrl } from '@nu-art/ts-short-url-shared';
2
- import { ThunderDispatcherV3 } from '@nu-art/thunderstorm-frontend/core/db-api-gen/types';
3
- import { apiWithQuery, ModuleFE_BaseApi } from '@nu-art/thunderstorm-frontend/index';
4
- export const dispatch_onShortUrlsUpdated = new ThunderDispatcherV3('__onShortUrlsUpdated');
5
- export class ModuleFE_ShortUrl_Class extends ModuleFE_BaseApi {
6
- _v1;
7
- constructor() {
8
- super(DBDef_ShortUrl, dispatch_onShortUrlsUpdated);
9
- this._v1 = {
10
- getShortUrl: apiWithQuery(ApiDef_ShortUrl._v1.getShortUrl)
11
- };
1
+ /*
2
+ * Copyright (C) 2026 Adam van der Kruk aka TacB0sS
3
+ * Licensed under the Apache License, Version 2.0
4
+ */
5
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
6
+ var useValue = arguments.length > 2;
7
+ for (var i = 0; i < initializers.length; i++) {
8
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
12
9
  }
13
- }
10
+ return useValue ? value : void 0;
11
+ };
12
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
13
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
14
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
15
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
16
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
17
+ var _, done = false;
18
+ for (var i = decorators.length - 1; i >= 0; i--) {
19
+ var context = {};
20
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
21
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
22
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
23
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
24
+ if (kind === "accessor") {
25
+ if (result === void 0) continue;
26
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
27
+ if (_ = accept(result.get)) descriptor.get = _;
28
+ if (_ = accept(result.set)) descriptor.set = _;
29
+ if (_ = accept(result.init)) initializers.unshift(_);
30
+ }
31
+ else if (_ = accept(result)) {
32
+ if (kind === "field") initializers.unshift(_);
33
+ else descriptor[key] = _;
34
+ }
35
+ }
36
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
37
+ done = true;
38
+ };
39
+ import { ApiDef_ShortUrl, DBDef_ShortUrl, } from '@nu-art/ts-short-url-shared';
40
+ import { ApiCaller } from '@nu-art/http-client';
41
+ import { CrudApiDef } from '@nu-art/db-api-shared';
42
+ import { buildConfigFromDBDef, ModuleFE_BaseApi } from '@nu-art/db-api-frontend';
43
+ const listeners = [];
44
+ export const dispatch_onShortUrlsUpdated = Object.assign(((...params) => {
45
+ listeners.forEach(fn => fn(...params));
46
+ }), {
47
+ addListener(fn) {
48
+ listeners.push(fn);
49
+ }
50
+ });
51
+ let ModuleFE_ShortUrl_Class = (() => {
52
+ let _classSuper = ModuleFE_BaseApi;
53
+ let _instanceExtraInitializers = [];
54
+ let _getShortUrl_decorators;
55
+ return class ModuleFE_ShortUrl_Class extends _classSuper {
56
+ static {
57
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
58
+ _getShortUrl_decorators = [ApiCaller(ApiDef_ShortUrl.getShortUrl)];
59
+ __esDecorate(this, null, _getShortUrl_decorators, { kind: "method", name: "getShortUrl", static: false, private: false, access: { has: obj => "getShortUrl" in obj, get: obj => obj.getShortUrl }, metadata: _metadata }, null, _instanceExtraInitializers);
60
+ if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
61
+ }
62
+ constructor() {
63
+ super({
64
+ config: buildConfigFromDBDef(DBDef_ShortUrl),
65
+ crudApiDef: CrudApiDef(DBDef_ShortUrl.dbKey),
66
+ dispatcher: dispatch_onShortUrlsUpdated
67
+ });
68
+ __runInitializers(this, _instanceExtraInitializers);
69
+ }
70
+ async getShortUrl(params) {
71
+ void params;
72
+ return undefined;
73
+ }
74
+ };
75
+ })();
76
+ export { ModuleFE_ShortUrl_Class };
14
77
  export const ModuleFE_ShortUrl = new ModuleFE_ShortUrl_Class();
@@ -1,36 +1,4 @@
1
1
  export declare const DropDown_ShortUrl: {
2
- editable: (props: import("@nu-art/thunderstorm-frontend/components/types").ComponentProps_Error & {
3
- dropdownRef?: import("react").RefObject<any>;
4
- className?: string;
5
- style?: import("react").CSSProperties;
6
- placeholder?: string;
7
- mapper?: ((item: import("@nu-art/ts-short-url-shared").DB_ShortUrl) => (string | undefined)[]) | undefined;
8
- noOptionsRenderer?: import("react").ReactNode | ((filter?: string) => import("react").ReactNode);
9
- renderer?: ((item: import("@nu-art/ts-short-url-shared").DB_ShortUrl) => import("react").ReactElement) | undefined;
10
- ifNoneShowAll?: boolean;
11
- caret?: {
12
- open: import("react").ReactNode;
13
- close: import("react").ReactNode;
14
- };
15
- onNoMatchingSelectionForString?: ((filterText: string, matchingItems: import("@nu-art/ts-short-url-shared").DB_ShortUrl[], e: import("react").KeyboardEvent) => any) | undefined;
16
- limitItems?: number;
17
- hidePlaceholderOnOpen?: boolean;
18
- itemResolver?: (() => import("@nu-art/ts-short-url-shared").DB_ShortUrl[]) | undefined;
19
- innerRef?: import("react").RefObject<any>;
20
- tabIndex?: number;
21
- unselectLabel?: string;
22
- id?: string;
23
- queryFilter?: ((item: import("@nu-art/ts-short-url-shared").DB_ShortUrl) => boolean) | undefined;
24
- sortBy?: ("title" | "description" | "_id" | "__metadata1" | "__hardDelete" | "__created" | "__updated" | "_v" | "_originDocId" | "_shortUrl" | "fullUrl" | ((item: import("@nu-art/ts-short-url-shared").DB_ShortUrl) => string | number))[] | undefined;
25
- } & {
26
- inputValue?: string;
27
- boundingParentSelector?: string;
28
- renderSearch?: ((dropDown: import("@nu-art/thunderstorm-frontend/index").TS_DropDown<import("@nu-art/ts-short-url-shared").DB_ShortUrl>) => import("react").ReactNode) | undefined;
29
- limitItems?: number;
30
- disabled?: boolean;
31
- } & import("@nu-art/thunderstorm-frontend/index").UIProps_EditableItem<any, any, string> & {
32
- onSelected?: ((selected: import("@nu-art/ts-short-url-shared").DB_ShortUrl | undefined, superOnSelected: (selected?: import("@nu-art/ts-short-url-shared").DB_ShortUrl | undefined) => Promise<void>) => void) | undefined;
33
- canUnselect?: boolean;
34
- }) => import("react/jsx-runtime").JSX.Element;
35
- selectable: (props: import("@nu-art/thunderstorm-frontend/index").AppLevelProps_TS_GenericDropDownV3<import("@nu-art/ts-short-url-shared").DB_ShortUrl>) => import("react/jsx-runtime").JSX.Element;
2
+ editable: (props: import("@nu-art/editable-item").EditableItemProps_GenericDropDown<any>) => import("react/jsx-runtime").JSX.Element;
3
+ selectable: (props: import("@nu-art/editable-item").AppLevelProps_TS_GenericDropDown<any>) => import("react/jsx-runtime").JSX.Element;
36
4
  };
@@ -1,11 +1,11 @@
1
1
  import { jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { ModuleFE_ShortUrl } from './ModuleFE_ShortUrl.js';
3
- import { GenericDropDownV3 } from '@nu-art/thunderstorm-frontend/index';
3
+ import { prepareGenericDropDown } from '@nu-art/editable-item';
4
4
  const Props_DropDown = {
5
5
  module: ModuleFE_ShortUrl,
6
6
  modules: [ModuleFE_ShortUrl],
7
- mapper: item => [item.title],
7
+ mapper: (item) => [item.title],
8
8
  placeholder: 'Choose a ShortUrl',
9
- renderer: item => _jsxs("div", { className: "ll_h_c", children: [" ", item.title, " "] })
9
+ renderer: (item) => _jsxs("div", { className: "ll_h_c", children: [" ", item.title, " "] })
10
10
  };
11
- export const DropDown_ShortUrl = GenericDropDownV3.prepare(Props_DropDown);
11
+ export const DropDown_ShortUrl = prepareGenericDropDown(Props_DropDown);
package/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
- export * from './_ats/index.js';
2
- export * from './_entity/short-url/index.js';
1
+ export * from './_ats/ATS_ShortUrl/ATS_ShortUrl.js';
2
+ export * from './_entity/short-url/ModuleFE_ShortUrl.js';
3
+ export * from './_entity/short-url/module-pack.js';
package/index.js CHANGED
@@ -1,2 +1,3 @@
1
- export * from './_ats/index.js';
2
- export * from './_entity/short-url/index.js';
1
+ export * from './_ats/ATS_ShortUrl/ATS_ShortUrl.js';
2
+ export * from './_entity/short-url/ModuleFE_ShortUrl.js';
3
+ export * from './_entity/short-url/module-pack.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nu-art/ts-short-url-frontend",
3
- "version": "0.401.9",
3
+ "version": "0.500.6",
4
4
  "description": "ts-short-url - Express & Typescript based backend framework Frontend",
5
5
  "keywords": [
6
6
  "TacB0sS",
@@ -31,15 +31,21 @@
31
31
  "build": "tsc"
32
32
  },
33
33
  "dependencies": {
34
- "@nu-art/ts-short-url-shared": "0.401.9",
35
- "@nu-art/firebase-frontend": "0.401.9",
36
- "@nu-art/firebase-shared": "0.401.9",
37
- "@nu-art/permissions-frontend": "0.401.9",
38
- "@nu-art/permissions-shared": "0.401.9",
39
- "@nu-art/thunderstorm-frontend": "0.401.9",
40
- "@nu-art/thunderstorm-shared": "0.401.9",
41
- "@nu-art/ts-common": "0.401.9",
42
- "@nu-art/ts-styles": "0.401.9",
34
+ "@nu-art/ts-short-url-shared": "0.500.6",
35
+ "@nu-art/db-api-frontend": "0.500.6",
36
+ "@nu-art/db-api-shared": "0.500.6",
37
+ "@nu-art/editable-item": "0.500.6",
38
+ "@nu-art/http-client": "0.500.6",
39
+ "@nu-art/firebase-frontend": "0.500.6",
40
+ "@nu-art/firebase-shared": "0.500.6",
41
+ "@nu-art/permissions-frontend": "0.500.6",
42
+ "@nu-art/permissions-shared": "0.500.6",
43
+ "@nu-art/thunder-core": "0.500.6",
44
+ "@nu-art/thunder-routing": "0.500.6",
45
+ "@nu-art/thunder-ui-modules": "0.500.6",
46
+ "@nu-art/thunder-widgets": "0.500.6",
47
+ "@nu-art/ts-common": "0.500.6",
48
+ "@nu-art/ts-styles": "0.500.6",
43
49
  "firebase": "^11.9.0",
44
50
  "firebase-admin": "13.4.0",
45
51
  "firebase-functions": "6.3.2",
package/_ats/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './ATS_ShortUrl/ATS_ShortUrl.js';
package/_ats/index.js DELETED
@@ -1 +0,0 @@
1
- export * from './ATS_ShortUrl/ATS_ShortUrl.js';
@@ -1,2 +0,0 @@
1
- export * from './ModuleFE_ShortUrl.js';
2
- export * from './module-pack.js';
@@ -1,2 +0,0 @@
1
- export * from './ModuleFE_ShortUrl.js';
2
- export * from './module-pack.js';