namirasoft-account-react 1.5.16 → 1.5.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.
@@ -1,9 +1,9 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { NamirasoftAccountServer, TokenManager } from "namirasoft-account";
3
3
  import { EncodingOperation, EnvService, IStorageCookie, ObjectService, URLOperation } from "namirasoft-core";
4
4
  import { KeyOperation, LinkOperation, NSRouterMaker } from 'namirasoft-site-react';
5
5
  import queryString from 'query-string';
6
- import React from 'react';
6
+ import React, { cloneElement } from 'react';
7
7
  import { NSAConsentPage } from './pages/NSAConsentPage';
8
8
  import { NSAEmailVerificationPage } from './pages/NSAEmailVerificationPage';
9
9
  import { NSAPhoneVerificationPage } from './pages/NSAPhoneVerificationPage';
@@ -34,8 +34,11 @@ export class NSARouterMaker extends React.Component {
34
34
  getQueryStrings: this.getQueryStrings,
35
35
  getQuery: this.getQuery,
36
36
  navigate: this.props.navigate,
37
- }, renderer: {
38
- renderOnNSALayout: this.props.getNSALayout
37
+ }, layout: {
38
+ getNSALayout: (key, props, children) => {
39
+ let layout = this.props.getNSALayout(props, children);
40
+ return cloneElement(layout, { key });
41
+ }
39
42
  } }, ns_router_maker_props);
40
43
  }
41
44
  getQueryStrings() {
@@ -83,12 +86,12 @@ export class NSARouterMaker extends React.Component {
83
86
  if (this.props.requirement.verification.email) {
84
87
  let e_verified = nsa_result.account.token_manager.getUserData(u => u.e_verified, false);
85
88
  if (!e_verified)
86
- return this.props.getNSALayout(nsa_result, _jsx(NSAEmailVerificationPage, Object.assign({}, nsa_result, { callback: '' })));
89
+ return nsa_result.layout.getNSALayout("nsa-page-email-verification", Object.assign(Object.assign({}, nsa_result), { children: _jsx(NSAEmailVerificationPage, Object.assign({}, nsa_result, { callback: '' })) }), _jsx(_Fragment, {}));
87
90
  }
88
91
  if (this.props.requirement.verification.phone) {
89
92
  let p_verified = nsa_result.account.token_manager.getUserData(u => u.p_verified, false);
90
93
  if (!p_verified)
91
- return this.props.getNSALayout(nsa_result, _jsx(NSAPhoneVerificationPage, Object.assign({}, nsa_result, { callback: '' })));
94
+ return nsa_result.layout.getNSALayout("nsa-page-phone-verification", Object.assign(Object.assign({}, nsa_result), { children: _jsx(NSAPhoneVerificationPage, Object.assign({}, nsa_result, { callback: '' })) }), _jsx(_Fragment, {}));
92
95
  }
93
96
  return this.props.renderOnLogin(nsa_result);
94
97
  } }));
@@ -1 +1 @@
1
- {"version":3,"file":"NSARouterMaker.js","sourceRoot":"","sources":["../src/NSARouterMaker.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa,EAAmB,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC9H,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAuB,MAAM,uBAAuB,CAAC;AACxG,OAAO,WAA4B,MAAM,cAAc,CAAC;AACxD,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAE5E,MAAM,OAAO,cAAe,SAAQ,KAAK,CAAC,SAA8B;IAEpE,YAAY,KAA0B;QAElC,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,aAAa,CAAC,WAAW,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC1C,YAAY,CAAC,KAAK,EAAE,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,eAAe,GAAG,IAAI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AC;YAEzD,CAAC,GACH,CAAC;IACP,CAAC;CACJ;AAAA,CAAC"}
@@ -2,6 +2,7 @@ import { IStorage } from "namirasoft-core";
2
2
  import React from "react";
3
3
  import type { NavigateFunction } from "react-router-dom";
4
4
  import { NSARouterMakerResult } from "./NSARouterMakerResult";
5
+ import { NSALayoutCustomProps } from "./layouts/NSALayout";
5
6
  export interface NSARouterMakerProps {
6
7
  notifier_storage: IStorage;
7
8
  page_force_update: () => void;
@@ -9,7 +10,9 @@ export interface NSARouterMakerProps {
9
10
  navigate: NavigateFunction;
10
11
  renderOnLogin(result: NSARouterMakerResult): React.JSX.Element;
11
12
  renderOnLogout(result: NSARouterMakerResult, banned: boolean): React.JSX.Element;
12
- getNSALayout(result: NSARouterMakerResult, children: React.JSX.Element): React.JSX.Element;
13
+ getNSALayout<RowType extends {
14
+ id: string;
15
+ }, RowTypeInput = RowType>(props: NSALayoutCustomProps<RowType, RowTypeInput>, children: React.JSX.Element): React.JSX.Element;
13
16
  requirement: {
14
17
  verification: {
15
18
  email: boolean;
@@ -3,6 +3,7 @@ import { ParsedNameValue } from "namirasoft-core";
3
3
  import { NSRouterMakerResult } from "namirasoft-site-react";
4
4
  import { ParsedQuery } from "query-string";
5
5
  import { NavigateFunction } from "react-router-dom";
6
+ import { NSALayoutCustomProps } from "./layouts/NSALayout";
6
7
  export interface NSARouterMakerResult extends NSRouterMakerResult {
7
8
  product_id: string;
8
9
  account: {
@@ -20,7 +21,9 @@ export interface NSARouterMakerResult extends NSRouterMakerResult {
20
21
  }): void;
21
22
  navigate: NavigateFunction;
22
23
  };
23
- renderer: {
24
- renderOnNSALayout(props: NSARouterMakerResult, children: React.JSX.Element): React.JSX.Element;
24
+ layout: {
25
+ getNSALayout<RowType extends {
26
+ id: string;
27
+ }, RowTypeInput = RowType>(key: string, props: NSALayoutCustomProps<RowType, RowTypeInput>, children: React.JSX.Element): React.JSX.Element;
25
28
  };
26
29
  }
@@ -1,8 +1,7 @@
1
1
  import { EntityResolveResponseRow } from 'namirasoft-field';
2
2
  import { ReactNode } from 'react';
3
- import { NSARouterMakerResult } from './NSARouterMakerResult';
4
- export interface NSFRouterMakerProps extends NSARouterMakerResult {
5
- children: ReactNode;
3
+ import { NSALayoutCustomProps } from './main';
4
+ export interface NSFRouterMakerProps extends NSALayoutCustomProps<any, any> {
6
5
  rows: EntityResolveResponseRow;
7
6
  }
8
7
  export declare class NSFRouterMaker {
@@ -1 +1 @@
1
- {"version":3,"file":"NSFRouterMaker.js","sourceRoot":"","sources":["../src/NSFRouterMaker.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAA8C,qBAAqB,EAAE,cAAc,EAAW,MAAM,kBAAkB,CAAC;AAE9H,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAQlE,MAAM,OAAO,cAAc;IAEvB,MAAM,CAAC,SAAS,CAAC,KAA0B;;QAEvC,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;QACvB,MAAM,WAAW,GAAG,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,KAAK,cAAc,CAAC,aAAa,CAAC,mCAAI,EAAE,CAAC;QAClG,IAAI,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,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AAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,cAAc,IAAI,IAA9L,GAAG,IAAI,CAAC,EAAE,gBAAgB,CAAwK;SACjN,CAAC,CAAC;IACP,CAAC;CACJ"}
@@ -1,9 +1,9 @@
1
- import { CategoryScopeRow, SlotRow } from "namirasoft-field";
1
+ import { CategoryRow, CategoryScopeRow, SlotRow } from "namirasoft-field";
2
2
  import { NSBoxString, NSBoxTextArea } from "namirasoft-site-react";
3
3
  import { Component } from "react";
4
- import { NSARouterMakerResult } from "../NSARouterMakerResult";
4
+ import { NSALayoutCustomProps } from "../layouts/NSALayout";
5
5
  import { NSFRouterProps } from "../NSFRouterProps";
6
- export interface NSFCategoryEditPageProps extends NSARouterMakerResult, NSFRouterProps {
6
+ export interface NSFCategoryEditPageProps extends NSALayoutCustomProps<CategoryRow>, NSFRouterProps {
7
7
  slot: SlotRow;
8
8
  category_scope: CategoryScopeRow;
9
9
  isEdit: boolean;
@@ -14,6 +14,6 @@ export declare class NSFCategoryEditPage extends Component<NSFCategoryEditPagePr
14
14
  NSBoxString_Name: import("react").RefObject<NSBoxString>;
15
15
  NSBoxTexArea_Description: import("react").RefObject<NSBoxTextArea>;
16
16
  constructor(props: NSFCategoryEditPageProps);
17
- render(): import("react/jsx-runtime").JSX.Element;
17
+ render(): import("react").JSX.Element;
18
18
  }
19
19
  export {};
@@ -1,7 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { NSBox, NSBoxString, NSBoxTextArea, NSColumn, NSRow } from "namirasoft-site-react";
3
3
  import { Component, createRef } from "react";
4
- import { NSALayout } from "../layouts/NSALayout";
5
4
  import { NSFEntities } from "./NSFEntities";
6
5
  export class NSFCategoryEditPage extends Component {
7
6
  constructor(props) {
@@ -11,7 +10,7 @@ export class NSFCategoryEditPage extends Component {
11
10
  this.state = {};
12
11
  }
13
12
  render() {
14
- return (_jsx(NSALayout, Object.assign({}, this.props, { action: {
13
+ return this.props.layout.getNSALayout("nsf-page-category-view", Object.assign(Object.assign({}, this.props), { action: {
15
14
  description: this.props.isEdit ? "This section allows you to update the details of an existing category." : "This section allows you to add a new category by entering its details."
16
15
  }, pages: {
17
16
  entity: NSFEntities.category(this.props, this.props.slot, this.props.category_scope),
@@ -41,7 +40,7 @@ export class NSFCategoryEditPage extends Component {
41
40
  }
42
41
  }
43
42
  } })
44
- }, children: _jsxs(NSColumn, { children: [_jsx(NSRow, { children: _jsx(NSBoxString, { ref: this.NSBoxString_Name, title: "Name", required: true, style: { width: NSBox.width.double }, info: { link: "https://namirasoft.com/field/console-guide/category/#field-name" } }) }), _jsx(NSBoxTextArea, { ref: this.NSBoxTexArea_Description, title: "Description", required: false, style: { width: NSBox.width.double }, info: { link: "https://namirasoft.com/field/console-guide/category/#field-description" } })] }) })));
43
+ } }), _jsxs(NSColumn, { children: [_jsx(NSRow, { children: _jsx(NSBoxString, { ref: this.NSBoxString_Name, title: "Name", required: true, style: { width: NSBox.width.double }, info: { link: "https://namirasoft.com/field/console-guide/category/#field-name" } }) }), _jsx(NSBoxTextArea, { ref: this.NSBoxTexArea_Description, title: "Description", required: false, style: { width: NSBox.width.double }, info: { link: "https://namirasoft.com/field/console-guide/category/#field-description" } })] }));
45
44
  }
46
45
  }
47
46
  //# sourceMappingURL=NSFCategoryEditPage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NSFCategoryEditPage.js","sourceRoot":"","sources":["../../src/pages/NSFCategoryEditPage.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC3F,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGjD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAW5C,MAAM,OAAO,mBAAoB,SAA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AAQ,CAAC,MAAA,GAAG,CAAC,WAAW,mCAAI,EAAE,CAAC,CAAC;gCACxE,CAAC;6BACD;yBACD;qBACD,GACD;aACD,KAED,MAAC,QAAQ,eACR,KAAC,KAAK,cACL,KAAC,WAAW,IACX,GAAG,EAAE,IAAI,CAAC,gBAAgB,EAC1B,KAAK,EAAC,MAAM,EACZ,QAAQ,QACR,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,EACpC,IAAI,EAAE,EAAE,IAAI,EAAE,iEAAiE,EAAE,GAChF,GACK,EACR,KAAC,aAAa,IACb,GAAG,EAAE,IAAI,CAAC,wBAAwB,EAClC,KAAK,EAAC,aAAa,EACnB,QAAQ,EAAE,KAAK,EACf,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,EACpC,IAAI,EAAE,EAAE,IAAI,EAAE,wEAAwE,EAAE,GACvF,IACQ,CACX,CAAC;IACH,CAAC;CACD"}
@@ -1,8 +1,8 @@
1
- import { CategoryScopeRow, SlotRow } from "namirasoft-field";
2
- import { NSARouterMakerResult } from "../NSARouterMakerResult";
1
+ import { CategoryRow, CategoryScopeRow, SlotRow } from "namirasoft-field";
2
+ import { NSALayoutCustomProps } from "../layouts/NSALayout";
3
3
  import { NSFRouterProps } from "../NSFRouterProps";
4
- export interface NSFCategoryListPageProps extends NSARouterMakerResult, NSFRouterProps {
4
+ export interface NSFCategoryListPageProps extends NSALayoutCustomProps<CategoryRow>, NSFRouterProps {
5
5
  slot: SlotRow;
6
6
  category_scope: CategoryScopeRow;
7
7
  }
8
- export declare function NSFCategoryListPage(props: NSFCategoryListPageProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function NSFCategoryListPage(props: NSFCategoryListPageProps): import("react").JSX.Element;
@@ -1,12 +1,11 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
- import { NSALayout } from "../layouts/NSALayout";
3
2
  import { NSFEntities } from "./NSFEntities";
4
3
  export function NSFCategoryListPage(props) {
5
- return (_jsx(NSALayout, Object.assign({}, props, { action: {
4
+ return props.layout.getNSALayout("nsf-page-category-view", Object.assign(Object.assign({}, props), { action: {
6
5
  description: "This section displays all categories you have created with their basic information."
7
6
  }, pages: {
8
7
  entity: NSFEntities.category(props, props.slot, props.category_scope),
9
8
  list: {}
10
- }, children: _jsx(_Fragment, {}) })));
9
+ } }), _jsx(_Fragment, {}));
11
10
  }
12
11
  //# sourceMappingURL=NSFCategoryListPage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NSFCategoryListPage.js","sourceRoot":"","sources":["../../src/pages/NSFCategoryListPage.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGjD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAQ5C,MAAM,UAAU,mBAAmB,CAAC,KAA+B;IAElE,OAAO,CACN,KAAC,SAAS,oBACL,KAAK,IACT,MAAM,EAAE;YACP,WAAW,EAAE,qFAAqF;SAClG,EACD,KAAK,EAAE;YACN,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,cAAc,CAAC;YACrE,IAAI,EAAE,EAAE;SACR,YAED,mBACG,IACQ,CACZ,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"NSFCategoryListPage.js","sourceRoot":"","sources":["../../src/pages/NSFCategoryListPage.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAQ5C,MAAM,UAAU,mBAAmB,CAAC,KAA+B;IAElE,OAAO,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,wBAAwB,kCACrD,KAAK,KACR,MAAM,EAAE;YACP,WAAW,EAAE,qFAAqF;SAClG,EACD,KAAK,EAAE;YACN,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,cAAc,CAAC;YACrE,IAAI,EAAE,EAAE;SACR,KACC,mBAAK,CAAC,CAAC;AACX,CAAC"}
@@ -1,8 +1,8 @@
1
- import { CategoryScopeRow, SlotRow } from "namirasoft-field";
2
- import { NSARouterMakerResult } from "../NSARouterMakerResult";
1
+ import { CategoryRow, CategoryScopeRow, SlotRow } from "namirasoft-field";
2
+ import { NSALayoutCustomProps } from "../layouts/NSALayout";
3
3
  import { NSFRouterProps } from "../NSFRouterProps";
4
- export interface NSFCategoryViewPageProps extends NSARouterMakerResult, NSFRouterProps {
4
+ export interface NSFCategoryViewPageProps extends NSALayoutCustomProps<CategoryRow>, NSFRouterProps {
5
5
  slot: SlotRow;
6
6
  category_scope: CategoryScopeRow;
7
7
  }
8
- export declare function NSFCategoryViewPage(props: NSFCategoryViewPageProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function NSFCategoryViewPage(props: NSFCategoryViewPageProps): import("react").JSX.Element;
@@ -1,12 +1,11 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
- import { NSALayout } from "../layouts/NSALayout";
3
2
  import { NSFEntities } from "./NSFEntities";
4
3
  export function NSFCategoryViewPage(props) {
5
- return (_jsx(NSALayout, Object.assign({}, props, { action: {
4
+ return props.layout.getNSALayout("nsf-page-category-view", Object.assign(Object.assign({}, props), { action: {
6
5
  description: "This section displays detailed information about a selected category."
7
6
  }, pages: {
8
7
  entity: NSFEntities.category(props, props.slot, props.category_scope),
9
8
  view: {}
10
- }, children: _jsx(_Fragment, { children: " " }) })));
9
+ } }), _jsx(_Fragment, {}));
11
10
  }
12
11
  //# sourceMappingURL=NSFCategoryViewPage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NSFCategoryViewPage.js","sourceRoot":"","sources":["../../src/pages/NSFCategoryViewPage.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGjD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAQ5C,MAAM,UAAU,mBAAmB,CAAC,KAA+B;IAElE,OAAO,CACN,KAAC,SAAS,oBACL,KAAK,IACT,MAAM,EAAE;YACP,WAAW,EAAE,uEAAuE;SACpF,EACD,KAAK,EAAE;YACN,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,cAAc,CAAC;YACrE,IAAI,EAAE,EAAE;SACR,YAED,kCAAM,IACK,CACZ,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"NSFCategoryViewPage.js","sourceRoot":"","sources":["../../src/pages/NSFCategoryViewPage.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAQ5C,MAAM,UAAU,mBAAmB,CAAC,KAA+B;IAElE,OAAO,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,wBAAwB,kCACrD,KAAK,KACR,MAAM,EAAE;YACP,WAAW,EAAE,uEAAuE;SACpF,EACD,KAAK,EAAE;YACN,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,cAAc,CAAC;YACrE,IAAI,EAAE,EAAE;SACR,KACC,mBAAK,CAAC,CAAC;AACX,CAAC"}
@@ -1,11 +1,13 @@
1
- import { Component } from "react";
2
- import { IBaseComponentProps } from "namirasoft-site-react";
3
1
  import { SubscriptionValidation } from "namirasoft-payment";
2
+ import { IBaseComponentProps } from "namirasoft-site-react";
3
+ import { Component } from "react";
4
4
  import { NSARouterMakerResult } from "../NSARouterMakerResult";
5
5
  export interface PaymentRequiredProps extends IBaseComponentProps, NSARouterMakerResult {
6
6
  tilte: string;
7
7
  description: string;
8
- action: string;
8
+ button: {
9
+ action: string;
10
+ };
9
11
  payment_offer_url: string;
10
12
  Validation: () => Promise<SubscriptionValidation>;
11
13
  children: JSX.Element;
@@ -16,6 +18,6 @@ interface PaymentRequiredState {
16
18
  export declare class PaymentRequired extends Component<PaymentRequiredProps, PaymentRequiredState> {
17
19
  constructor(props: PaymentRequiredProps);
18
20
  componentDidMount(): void;
19
- render(): JSX.Element;
21
+ render(): import("react").JSX.Element;
20
22
  }
21
23
  export {};
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Component, cloneElement } from "react";
3
- import { LinkOperation, NSBox, NSButtonGreen, NSLabel, NSLoading, NSPanel, NSRow, NSSection } from "namirasoft-site-react";
4
2
  import { EncodingOperation } from "namirasoft-core";
3
+ import { LinkOperation, NSBox, NSButtonGreen, NSLabel, NSLoading, NSPanel, NSRow, NSSection } from "namirasoft-site-react";
4
+ import { Component } from "react";
5
5
  export class PaymentRequired extends Component {
6
6
  constructor(props) {
7
7
  super(props);
@@ -14,13 +14,12 @@ export class PaymentRequired extends Component {
14
14
  }
15
15
  render() {
16
16
  if (this.state.subscribed == null) {
17
- let layout = this.props.renderer.renderOnNSALayout(this.props, _jsx(NSLoading, {}));
18
- return cloneElement(layout, { key: "loading" });
17
+ return this.props.layout.getNSALayout("loading", this.props, _jsx(NSLoading, { title: "Loading Namirasoft Payment Information" }));
19
18
  }
20
19
  if (!this.state.subscribed) {
21
20
  let section = _jsx(NSSection, { children: _jsx(NSPanel, { children: _jsxs(NSRow, { style: {
22
21
  width: NSBox.width.double
23
- }, children: [_jsx(NSLabel, { title: this.props.tilte, description: this.props.description }), _jsx(NSButtonGreen, { title: this.props.action, onClick: {
22
+ }, children: [_jsx(NSLabel, { title: this.props.tilte, description: this.props.description }), _jsx(NSButtonGreen, { title: this.props.button.action, onClick: {
24
23
  action: () => {
25
24
  let callback = EncodingOperation.Base64Encode(window.location.href);
26
25
  let link = this.props.payment_offer_url + "?callback=" + callback;
@@ -28,8 +27,7 @@ export class PaymentRequired extends Component {
28
27
  },
29
28
  showLoading: false
30
29
  } })] }) }) });
31
- let layout = this.props.renderer.renderOnNSALayout(this.props, section);
32
- return cloneElement(layout, { key: "payment-required" });
30
+ return this.props.layout.getNSALayout("payment-required", this.props, section);
33
31
  }
34
32
  return this.props.children;
35
33
  }
@@ -1 +1 @@
1
- {"version":3,"file":"PaymentRequired.js","sourceRoot":"","sources":["../../src/pages/PaymentRequired.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAuB,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAChJ,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAmBpD,MAAM,OAAO,eAAgB,SAAQ,SAAqD;IAEzF,YAAY,KAA2B;QAEtC,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;IACnC,CAAC;IACQ,iBAAiB;QAEzB,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;YAElC,IAAI,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IACrB,CAAC;IACQ,MAAM;QAEd,IAAI,IAAI,CAAC,KAAK,CAAC,UAAU,IAAI,IAAI,EACjC,CAAC;YACA,IAAI,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,EAAE,KAAC,SAAS,KAAG,CAAC,CAAA;YAC7E,OAAO,YAAY,CAAC,MAAM,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC;QACjD,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,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AAG,iBAAiB,CAAC,YAAY,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;wCACpE,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,GAAG,YAAY,GAAG,QAAQ,CAAC;wCAClE,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oCAC1B,CAAC;oCACD,WAAW,EAAE,KAAK;iCAClB,GACe,IACV,GACC,GACC,CAAC;YACb,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,kBAAkB,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;QAC/E,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;IAC5B,CAAC;CACD"}
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "framework": "npm",
9
9
  "application": "package",
10
10
  "private": false,
11
- "version": "1.5.16",
11
+ "version": "1.5.18",
12
12
  "author": "Amir Abolhasani",
13
13
  "license": "MIT",
14
14
  "main": "./dist/main.js",
@@ -2,7 +2,8 @@ import { NamirasoftAccountServer, TokenManager } from "namirasoft-account";
2
2
  import { EncodingOperation, EnvService, IStorageCookie, ObjectService, ParsedNameValue, URLOperation } from "namirasoft-core";
3
3
  import { KeyOperation, LinkOperation, NSRouterMaker, NSRouterMakerResult } from 'namirasoft-site-react';
4
4
  import queryString, { ParsedQuery } from 'query-string';
5
- import React from 'react';
5
+ import React, { cloneElement } from 'react';
6
+ import { NSALayoutCustomProps } from "./main";
6
7
  import { NSARouterMakerProps } from "./NSARouterMakerProps";
7
8
  import { NSARouterMakerResult } from "./NSARouterMakerResult";
8
9
  import { NSAConsentPage } from './pages/NSAConsentPage';
@@ -45,8 +46,12 @@ export class NSARouterMaker extends React.Component<NSARouterMakerProps>
45
46
  getQuery: this.getQuery,
46
47
  navigate: this.props.navigate,
47
48
  },
48
- renderer: {
49
- renderOnNSALayout: this.props.getNSALayout
49
+ layout: {
50
+ getNSALayout: (key: string, props: NSALayoutCustomProps<any, any>, children: React.JSX.Element) =>
51
+ {
52
+ let layout = this.props.getNSALayout(props, children);
53
+ return cloneElement(layout, { key });
54
+ }
50
55
  },
51
56
  ...ns_router_maker_props
52
57
  };
@@ -115,13 +120,13 @@ export class NSARouterMaker extends React.Component<NSARouterMakerProps>
115
120
  {
116
121
  let e_verified = nsa_result.account.token_manager.getUserData(u => u.e_verified, false);
117
122
  if (!e_verified)
118
- return this.props.getNSALayout(nsa_result, <NSAEmailVerificationPage {...nsa_result} callback='' />);
123
+ return nsa_result.layout.getNSALayout("nsa-page-email-verification", { ...nsa_result, children: <NSAEmailVerificationPage {...nsa_result} callback='' /> }, <></>);
119
124
  }
120
125
  if (this.props.requirement.verification.phone)
121
126
  {
122
127
  let p_verified = nsa_result.account.token_manager.getUserData(u => u.p_verified, false);
123
128
  if (!p_verified)
124
- return this.props.getNSALayout(nsa_result, <NSAPhoneVerificationPage {...nsa_result} callback='' />);
129
+ return nsa_result.layout.getNSALayout("nsa-page-phone-verification", { ...nsa_result, children: <NSAPhoneVerificationPage {...nsa_result} callback='' /> }, <></>);
125
130
  }
126
131
  return this.props.renderOnLogin(nsa_result);
127
132
  }}
@@ -2,6 +2,7 @@ import { IStorage } from "namirasoft-core";
2
2
  import React from "react";
3
3
  import type { NavigateFunction } from "react-router-dom";
4
4
  import { NSARouterMakerResult } from "./NSARouterMakerResult";
5
+ import { NSALayoutCustomProps } from "./layouts/NSALayout";
5
6
 
6
7
  export interface NSARouterMakerProps
7
8
  {
@@ -12,7 +13,7 @@ export interface NSARouterMakerProps
12
13
  navigate: NavigateFunction;
13
14
  renderOnLogin(result: NSARouterMakerResult): React.JSX.Element;
14
15
  renderOnLogout(result: NSARouterMakerResult, banned: boolean): React.JSX.Element;
15
- getNSALayout(result: NSARouterMakerResult, children: React.JSX.Element): React.JSX.Element;
16
+ getNSALayout<RowType extends { id: string }, RowTypeInput = RowType>(props: NSALayoutCustomProps<RowType, RowTypeInput>, children: React.JSX.Element): React.JSX.Element;
16
17
  requirement: {
17
18
  verification: {
18
19
  email: boolean;
@@ -3,6 +3,7 @@ import { ParsedNameValue } from "namirasoft-core";
3
3
  import { NSRouterMakerResult } from "namirasoft-site-react";
4
4
  import { ParsedQuery } from "query-string";
5
5
  import { NavigateFunction } from "react-router-dom";
6
+ import { NSALayoutCustomProps } from "./layouts/NSALayout";
6
7
 
7
8
  export interface NSARouterMakerResult extends NSRouterMakerResult
8
9
  {
@@ -18,8 +19,7 @@ export interface NSARouterMakerResult extends NSRouterMakerResult
18
19
  redirect(sub: string, customQuery: { [name: string]: ParsedNameValue }): void;
19
20
  navigate: NavigateFunction;
20
21
  },
21
- renderer:
22
- {
23
- renderOnNSALayout(props: NSARouterMakerResult, children: React.JSX.Element): React.JSX.Element;
22
+ layout: {
23
+ getNSALayout<RowType extends { id: string }, RowTypeInput = RowType>(key: string, props: NSALayoutCustomProps<RowType, RowTypeInput>, children: React.JSX.Element): React.JSX.Element;
24
24
  }
25
25
  }
@@ -2,15 +2,14 @@ import { EnvService } from 'namirasoft-core';
2
2
  import { CategoryScopeRow, EntityResolveResponseRow, NamirasoftFieldServer, SlotEntityType, SlotRow } from 'namirasoft-field';
3
3
  import { ReactNode } from 'react';
4
4
  import { Route } from 'react-router-dom';
5
- import { NSARouterMakerResult } from './NSARouterMakerResult';
5
+ import { NSALayoutCustomProps } from './main';
6
6
  import { NSFRoutes } from './NSFRoutes';
7
7
  import { NSFCategoryEditPage } from './pages/NSFCategoryEditPage';
8
8
  import { NSFCategoryListPage } from './pages/NSFCategoryListPage';
9
9
  import { NSFCategoryViewPage } from './pages/NSFCategoryViewPage';
10
10
 
11
- export interface NSFRouterMakerProps extends NSARouterMakerResult
11
+ export interface NSFRouterMakerProps extends NSALayoutCustomProps<any, any>
12
12
  {
13
- children: ReactNode;
14
13
  rows: EntityResolveResponseRow;
15
14
  }
16
15
 
@@ -1,12 +1,11 @@
1
1
  import { CategoryInputRow, CategoryRow, CategoryScopeRow, SlotRow } from "namirasoft-field";
2
2
  import { NSBox, NSBoxString, NSBoxTextArea, NSColumn, NSRow } from "namirasoft-site-react";
3
3
  import { Component, createRef } from "react";
4
- import { NSALayout } from "../layouts/NSALayout";
5
- import { NSARouterMakerResult } from "../NSARouterMakerResult";
4
+ import { NSALayoutCustomProps } from "../layouts/NSALayout";
6
5
  import { NSFRouterProps } from "../NSFRouterProps";
7
6
  import { NSFEntities } from "./NSFEntities";
8
7
 
9
- export interface NSFCategoryEditPageProps extends NSARouterMakerResult, NSFRouterProps
8
+ export interface NSFCategoryEditPageProps extends NSALayoutCustomProps<CategoryRow>, NSFRouterProps
10
9
  {
11
10
  slot: SlotRow;
12
11
  category_scope: CategoryScopeRow;
@@ -28,65 +27,63 @@ export class NSFCategoryEditPage extends Component<NSFCategoryEditPageProps, NSF
28
27
 
29
28
  override render()
30
29
  {
31
- return (
32
- <NSALayout<CategoryRow, CategoryInputRow>
33
- {...this.props}
34
- action={{
35
- description: this.props.isEdit ? "This section allows you to update the details of an existing category." : "This section allows you to add a new category by entering its details."
36
- }}
37
- pages={{
38
- entity: NSFEntities.category(this.props, this.props.slot, this.props.category_scope),
39
- edit: {
40
- ...this.props,
41
- ui: {
42
- tab_page_edit: {
43
- editor: {
44
- getInputRow: () =>
45
- {
46
- let category_scope_id = this.props.category_scope.id;
47
- let name = this.NSBoxString_Name.current?.getValue() ?? "";
48
- let description = this.NSBoxTexArea_Description.current?.getValue() ?? "";
30
+ return this.props.layout.getNSALayout<CategoryRow, CategoryInputRow>("nsf-page-category-view", {
31
+ ...this.props,
32
+ action: {
33
+ description: this.props.isEdit ? "This section allows you to update the details of an existing category." : "This section allows you to add a new category by entering its details."
34
+ },
35
+ pages: {
36
+ entity: NSFEntities.category(this.props, this.props.slot, this.props.category_scope),
37
+ edit: {
38
+ ...this.props,
39
+ ui: {
40
+ tab_page_edit: {
41
+ editor: {
42
+ getInputRow: () =>
43
+ {
44
+ let category_scope_id = this.props.category_scope.id;
45
+ let name = this.NSBoxString_Name.current?.getValue() ?? "";
46
+ let description = this.NSBoxTexArea_Description.current?.getValue() ?? "";
49
47
 
50
- return {
51
- workspace_id: "",
52
- category_scope_id,
53
- name,
54
- description,
55
- category_category: [],
56
- category_field: [],
57
- category_tag: [],
58
- };
59
- },
60
- setRow: (row) =>
61
- {
62
- this.NSBoxString_Name.current?.setValue(row.name);
63
- this.NSBoxTexArea_Description.current?.setValue(row.description ?? "");
64
- }
48
+ return {
49
+ workspace_id: "",
50
+ category_scope_id,
51
+ name,
52
+ description,
53
+ category_category: [],
54
+ category_field: [],
55
+ category_tag: [],
56
+ };
57
+ },
58
+ setRow: (row) =>
59
+ {
60
+ this.NSBoxString_Name.current?.setValue(row.name);
61
+ this.NSBoxTexArea_Description.current?.setValue(row.description ?? "");
65
62
  }
66
63
  }
67
64
  }
68
65
  }
69
- }}
70
- >
71
- <NSColumn>
72
- <NSRow>
73
- <NSBoxString
74
- ref={this.NSBoxString_Name}
75
- title="Name"
76
- required
77
- style={{ width: NSBox.width.double }}
78
- info={{ link: "https://namirasoft.com/field/console-guide/category/#field-name" }}
79
- />
80
- </NSRow>
81
- <NSBoxTextArea
82
- ref={this.NSBoxTexArea_Description}
83
- title="Description"
84
- required={false}
66
+ }
67
+ }
68
+ },
69
+ <NSColumn>
70
+ <NSRow>
71
+ <NSBoxString
72
+ ref={this.NSBoxString_Name}
73
+ title="Name"
74
+ required
85
75
  style={{ width: NSBox.width.double }}
86
- info={{ link: "https://namirasoft.com/field/console-guide/category/#field-description" }}
76
+ info={{ link: "https://namirasoft.com/field/console-guide/category/#field-name" }}
87
77
  />
88
- </NSColumn>
89
- </NSALayout>
78
+ </NSRow>
79
+ <NSBoxTextArea
80
+ ref={this.NSBoxTexArea_Description}
81
+ title="Description"
82
+ required={false}
83
+ style={{ width: NSBox.width.double }}
84
+ info={{ link: "https://namirasoft.com/field/console-guide/category/#field-description" }}
85
+ />
86
+ </NSColumn>
90
87
  );
91
88
  }
92
89
  }
@@ -1,10 +1,9 @@
1
- import { CategoryScopeRow, SlotRow } from "namirasoft-field";
2
- import { NSALayout } from "../layouts/NSALayout";
3
- import { NSARouterMakerResult } from "../NSARouterMakerResult";
1
+ import { CategoryRow, CategoryScopeRow, SlotRow } from "namirasoft-field";
2
+ import { NSALayoutCustomProps } from "../layouts/NSALayout";
4
3
  import { NSFRouterProps } from "../NSFRouterProps";
5
4
  import { NSFEntities } from "./NSFEntities";
6
5
 
7
- export interface NSFCategoryListPageProps extends NSARouterMakerResult, NSFRouterProps
6
+ export interface NSFCategoryListPageProps extends NSALayoutCustomProps<CategoryRow>, NSFRouterProps
8
7
  {
9
8
  slot: SlotRow;
10
9
  category_scope: CategoryScopeRow;
@@ -12,19 +11,14 @@ export interface NSFCategoryListPageProps extends NSARouterMakerResult, NSFRoute
12
11
 
13
12
  export function NSFCategoryListPage(props: NSFCategoryListPageProps)
14
13
  {
15
- return (
16
- <NSALayout
17
- {...props}
18
- action={{
19
- description: "This section displays all categories you have created with their basic information."
20
- }}
21
- pages={{
22
- entity: NSFEntities.category(props, props.slot, props.category_scope),
23
- list: {}
24
- }}
25
- >
26
- <>
27
- </>
28
- </NSALayout>
29
- );
14
+ return props.layout.getNSALayout("nsf-page-category-view", {
15
+ ...props,
16
+ action: {
17
+ description: "This section displays all categories you have created with their basic information."
18
+ },
19
+ pages: {
20
+ entity: NSFEntities.category(props, props.slot, props.category_scope),
21
+ list: {}
22
+ }
23
+ }, <></>);
30
24
  }
@@ -1,10 +1,9 @@
1
- import { CategoryScopeRow, SlotRow } from "namirasoft-field";
2
- import { NSALayout } from "../layouts/NSALayout";
3
- import { NSARouterMakerResult } from "../NSARouterMakerResult";
1
+ import { CategoryRow, CategoryScopeRow, SlotRow } from "namirasoft-field";
2
+ import { NSALayoutCustomProps } from "../layouts/NSALayout";
4
3
  import { NSFRouterProps } from "../NSFRouterProps";
5
4
  import { NSFEntities } from "./NSFEntities";
6
5
 
7
- export interface NSFCategoryViewPageProps extends NSARouterMakerResult, NSFRouterProps
6
+ export interface NSFCategoryViewPageProps extends NSALayoutCustomProps<CategoryRow>, NSFRouterProps
8
7
  {
9
8
  slot: SlotRow;
10
9
  category_scope: CategoryScopeRow;
@@ -12,18 +11,14 @@ export interface NSFCategoryViewPageProps extends NSARouterMakerResult, NSFRoute
12
11
 
13
12
  export function NSFCategoryViewPage(props: NSFCategoryViewPageProps)
14
13
  {
15
- return (
16
- <NSALayout
17
- {...props}
18
- action={{
19
- description: "This section displays detailed information about a selected category."
20
- }}
21
- pages={{
22
- entity: NSFEntities.category(props, props.slot, props.category_scope),
23
- view: {}
24
- }}
25
- >
26
- <> </>
27
- </NSALayout>
28
- );
14
+ return props.layout.getNSALayout("nsf-page-category-view", {
15
+ ...props,
16
+ action: {
17
+ description: "This section displays detailed information about a selected category."
18
+ },
19
+ pages: {
20
+ entity: NSFEntities.category(props, props.slot, props.category_scope),
21
+ view: {}
22
+ }
23
+ }, <></>);
29
24
  }
@@ -1,14 +1,16 @@
1
- import { Component, cloneElement } from "react";
2
- import { IBaseComponentProps, LinkOperation, NSBox, NSButtonGreen, NSLabel, NSLoading, NSPanel, NSRow, NSSection } from "namirasoft-site-react";
3
1
  import { EncodingOperation } from "namirasoft-core";
4
2
  import { SubscriptionValidation } from "namirasoft-payment";
3
+ import { IBaseComponentProps, LinkOperation, NSBox, NSButtonGreen, NSLabel, NSLoading, NSPanel, NSRow, NSSection } from "namirasoft-site-react";
4
+ import { Component } from "react";
5
5
  import { NSARouterMakerResult } from "../NSARouterMakerResult";
6
6
 
7
7
  export interface PaymentRequiredProps extends IBaseComponentProps, NSARouterMakerResult
8
8
  {
9
9
  tilte: string;
10
10
  description: string;
11
- action: string;
11
+ button: {
12
+ action: string;
13
+ }
12
14
  payment_offer_url: string;
13
15
  Validation: () => Promise<SubscriptionValidation>;
14
16
  children: JSX.Element;
@@ -37,8 +39,9 @@ export class PaymentRequired extends Component<PaymentRequiredProps, PaymentRequ
37
39
  {
38
40
  if (this.state.subscribed == null)
39
41
  {
40
- let layout = this.props.renderer.renderOnNSALayout(this.props, <NSLoading />)
41
- return cloneElement(layout, { key: "loading" });
42
+ return this.props.layout.getNSALayout("loading", this.props, <NSLoading
43
+ title="Loading Namirasoft Payment Information"
44
+ />);
42
45
  }
43
46
  if (!this.state.subscribed)
44
47
  {
@@ -55,7 +58,7 @@ export class PaymentRequired extends Component<PaymentRequiredProps, PaymentRequ
55
58
  >
56
59
  </NSLabel>
57
60
  <NSButtonGreen
58
- title={this.props.action}
61
+ title={this.props.button.action}
59
62
  onClick={{
60
63
  action: () =>
61
64
  {
@@ -69,8 +72,7 @@ export class PaymentRequired extends Component<PaymentRequiredProps, PaymentRequ
69
72
  </NSRow>
70
73
  </NSPanel>
71
74
  </NSSection>;
72
- let layout = this.props.renderer.renderOnNSALayout(this.props, section)
73
- return cloneElement(layout, { key: "payment-required" });
75
+ return this.props.layout.getNSALayout("payment-required", this.props, section)
74
76
  }
75
77
  return this.props.children;
76
78
  }