@beinformed/ui 1.55.1 → 1.56.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,21 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
4
4
 
5
+ ## [1.56.0](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.55.2...v1.56.0) (2024-10-09)
6
+
7
+
8
+ ### Features
9
+
10
+ * **selector:** add selector to retrieve all modularui models ([78da09b](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/78da09b01be60e089be2094b9d025b64958f9463))
11
+
12
+ ## [1.55.2](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.55.1...v1.55.2) (2024-10-04)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * **flow:** ignore hermes lib for flowtype ([98930b0](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/98930b074d2e59bb970f9c2392d9ab375ed61e64))
18
+ * **modelcatalog:** set correct class name ([3a79aa4](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/3a79aa4c88c47bc90959a03f3a289143631b44c9))
19
+
5
20
  ## [1.55.1](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.55.0...v1.55.1) (2024-09-26)
6
21
 
7
22
 
@@ -4,7 +4,7 @@ import ModelCategoryModel from "./ModelCategoryModel";
4
4
  /**
5
5
  * Model category collection
6
6
  */
7
- export default class SourceReferenceCollection extends BaseCollection {
7
+ export default class ModelCategoryCollection extends BaseCollection {
8
8
  /**
9
9
  */
10
10
  constructor() {
@@ -1 +1 @@
1
- {"version":3,"file":"ModelCategoryCollection.js","names":["BaseCollection","ModelCategoryModel","SourceReferenceCollection","constructor","modelCategories","arguments","length","undefined","collection","_mapInstanceProperty","call","modelCategory"],"sources":["../../../src/models/modelcatalog/ModelCategoryCollection.js"],"sourcesContent":["// @flow\nimport BaseCollection from \"../base/BaseCollection\";\nimport ModelCategoryModel from \"./ModelCategoryModel\";\n\nimport type { ModelCategory } from \"./ModelCategoryModel\";\n\n/**\n * Model category collection\n */\nexport default class SourceReferenceCollection extends BaseCollection<ModelCategoryModel> {\n /**\n */\n constructor(modelCategories: Array<ModelCategory> = []) {\n super();\n\n this.collection = modelCategories\n ? modelCategories.map(\n (modelCategory) => new ModelCategoryModel(modelCategory),\n )\n : [];\n }\n}\n"],"mappings":";AACA,OAAOA,cAAc,MAAM,wBAAwB;AACnD,OAAOC,kBAAkB,MAAM,sBAAsB;AAIrD;AACA;AACA;AACA,eAAe,MAAMC,yBAAyB,SAASF,cAAc,CAAqB;EACxF;AACF;EACEG,WAAWA,CAAA,EAA6C;IAAA,IAA5CC,eAAqC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;IACpD,KAAK,CAAC,CAAC;IAEP,IAAI,CAACG,UAAU,GAAGJ,eAAe,GAC7BK,oBAAA,CAAAL,eAAe,EAAAM,IAAA,CAAfN,eAAe,EACZO,aAAa,IAAK,IAAIV,kBAAkB,CAACU,aAAa,CACzD,CAAC,GACD,EAAE;EACR;AACF","ignoreList":[]}
1
+ {"version":3,"file":"ModelCategoryCollection.js","names":["BaseCollection","ModelCategoryModel","ModelCategoryCollection","constructor","modelCategories","arguments","length","undefined","collection","_mapInstanceProperty","call","modelCategory"],"sources":["../../../src/models/modelcatalog/ModelCategoryCollection.js"],"sourcesContent":["// @flow\nimport BaseCollection from \"../base/BaseCollection\";\nimport ModelCategoryModel from \"./ModelCategoryModel\";\n\nimport type { ModelCategory } from \"./ModelCategoryModel\";\n\n/**\n * Model category collection\n */\nexport default class ModelCategoryCollection extends BaseCollection<ModelCategoryModel> {\n /**\n */\n constructor(modelCategories: Array<ModelCategory> = []) {\n super();\n\n this.collection = modelCategories\n ? modelCategories.map(\n (modelCategory) => new ModelCategoryModel(modelCategory),\n )\n : [];\n }\n}\n"],"mappings":";AACA,OAAOA,cAAc,MAAM,wBAAwB;AACnD,OAAOC,kBAAkB,MAAM,sBAAsB;AAIrD;AACA;AACA;AACA,eAAe,MAAMC,uBAAuB,SAASF,cAAc,CAAqB;EACtF;AACF;EACEG,WAAWA,CAAA,EAA6C;IAAA,IAA5CC,eAAqC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;IACpD,KAAK,CAAC,CAAC;IAEP,IAAI,CAACG,UAAU,GAAGJ,eAAe,GAC7BK,oBAAA,CAAAL,eAAe,EAAAM,IAAA,CAAfN,eAAe,EACZO,aAAa,IAAK,IAAIV,kBAAkB,CAACU,aAAa,CACzD,CAAC,GACD,EAAE;EACR;AACF","ignoreList":[]}
@@ -32,7 +32,7 @@ const renderSSRComplete = _ref => {
32
32
  // $FlowFixMe[prop-missing]
33
33
  const location = requestHref.toLocation();
34
34
  const basePath = getBasePath();
35
- return createSSRComplete(store, () => renderToString( /*#__PURE__*/_jsx(Provider, {
35
+ return createSSRComplete(store, () => renderToString(/*#__PURE__*/_jsx(Provider, {
36
36
  store: store,
37
37
  children: /*#__PURE__*/_jsx(StyleSheetManager, {
38
38
  sheet: sheet.instance,
@@ -63,7 +63,7 @@ const renderSSRComplete = _ref => {
63
63
  });
64
64
  }).catch(error => template({
65
65
  contextPath: basePath,
66
- html: renderToString( /*#__PURE__*/_jsx(StyleSheetManager, {
66
+ html: renderToString(/*#__PURE__*/_jsx(StyleSheetManager, {
67
67
  sheet: sheet.instance,
68
68
  children: /*#__PURE__*/_jsx(ThemeProvider, {
69
69
  theme: theme,
@@ -1 +1 @@
1
- {"version":3,"file":"renderSSRComplete.js","names":["renderToString","Provider","StaticRouter","Router","HelmetProvider","ServerStyleSheet","StyleSheetManager","createSSRComplete","htmlpage","getBasePath","ThemeProvider","ErrorBoundary","createHead","handleErrors","dehydrate","jsx","_jsx","renderSSRComplete","_ref","store","theme","UUID","requestHref","render","ErrorPage","template","helmetContext","helmet","routerContext","sheet","location","toLocation","basePath","children","instance","context","basename","then","appHTML","head","contextPath","html","state","catch","error","errorMessage","message","errorResource","fileName","errorLine","lineNumber","errorStack","stack"],"sources":["../../src/react-server/renderSSRComplete.js"],"sourcesContent":["// @flow\nimport { renderToString } from \"react-dom/server\";\nimport { Provider } from \"react-redux\";\nimport { StaticRouter as Router } from \"react-router\";\n\nimport { HelmetProvider } from \"react-helmet-async\";\n\nimport { ServerStyleSheet, StyleSheetManager } from \"styled-components\";\n\nimport createSSRComplete from \"./createSSRComplete\";\nimport htmlpage from \"./htmlpage\";\n\nimport { getBasePath } from \"../constants/Settings\";\n\nimport ThemeProvider from \"../react-theme/ThemeProvider\";\nimport ErrorBoundary from \"../react/ErrorBoundary\";\n\nimport { createHead, handleErrors, dehydrate } from \"./serverUtil\";\n\nimport type { Theme } from \"../react-theme/types\";\nimport type { ReduxStore } from \"../redux/types\";\nimport type Href from \"../models/href/Href\";\nimport type { TemplateProps } from \"./htmlpage\";\nimport type { Location } from \"react-router\";\n\ntype Props = {\n store: ReduxStore,\n theme: Theme,\n UUID: string,\n requestHref: Href,\n render: Function,\n ErrorPage: any,\n template?: (TemplateProps) => string,\n};\n/**\n */\nconst renderSSRComplete = ({\n store,\n theme,\n UUID = \"\",\n requestHref,\n render,\n ErrorPage,\n template = htmlpage,\n}: Props): Promise<string> => {\n const helmetContext = { helmet: {} };\n const routerContext = {};\n\n const sheet = new ServerStyleSheet();\n\n // $FlowFixMe[incompatible-type]\n // $FlowFixMe[prop-missing]\n const location: Location = requestHref.toLocation();\n\n const basePath = getBasePath();\n\n return createSSRComplete(store, () =>\n renderToString(\n <Provider store={store}>\n <StyleSheetManager sheet={sheet.instance}>\n <ThemeProvider theme={theme}>\n <HelmetProvider context={helmetContext}>\n <ErrorBoundary>\n <Router\n basename={basePath}\n location={location}\n context={routerContext}\n >\n {render()}\n </Router>\n </ErrorBoundary>\n </HelmetProvider>\n </ThemeProvider>\n </StyleSheetManager>\n </Provider>,\n ),\n )\n .then((appHTML) => {\n handleErrors(store);\n const head = createHead(sheet, UUID, helmetContext);\n return template({\n contextPath: basePath,\n html: appHTML,\n head,\n state: dehydrate(store),\n UUID,\n });\n })\n .catch((error) =>\n template({\n contextPath: basePath,\n html: renderToString(\n <StyleSheetManager sheet={sheet.instance}>\n <ThemeProvider theme={theme}>\n <ErrorPage\n errorMessage={error.message}\n errorResource={error.fileName}\n errorLine={error.lineNumber}\n errorStack={error.stack}\n />\n </ThemeProvider>\n </StyleSheetManager>,\n ),\n head: helmetContext.helmet,\n state: \"\",\n UUID,\n }),\n );\n};\n\nexport default renderSSRComplete;\n"],"mappings":"AACA,SAASA,cAAc,QAAQ,kBAAkB;AACjD,SAASC,QAAQ,QAAQ,aAAa;AACtC,SAASC,YAAY,IAAIC,MAAM,QAAQ,cAAc;AAErD,SAASC,cAAc,QAAQ,oBAAoB;AAEnD,SAASC,gBAAgB,EAAEC,iBAAiB,QAAQ,mBAAmB;AAEvE,OAAOC,iBAAiB,MAAM,qBAAqB;AACnD,OAAOC,QAAQ,MAAM,YAAY;AAEjC,SAASC,WAAW,QAAQ,uBAAuB;AAEnD,OAAOC,aAAa,MAAM,8BAA8B;AACxD,OAAOC,aAAa,MAAM,wBAAwB;AAElD,SAASC,UAAU,EAAEC,YAAY,EAAEC,SAAS,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAiBnE;AACA;AACA,MAAMC,iBAAiB,GAAGC,IAAA,IAQI;EAAA,IARH;IACzBC,KAAK;IACLC,KAAK;IACLC,IAAI,GAAG,EAAE;IACTC,WAAW;IACXC,MAAM;IACNC,SAAS;IACTC,QAAQ,GAAGjB;EACN,CAAC,GAAAU,IAAA;EACN,MAAMQ,aAAa,GAAG;IAAEC,MAAM,EAAE,CAAC;EAAE,CAAC;EACpC,MAAMC,aAAa,GAAG,CAAC,CAAC;EAExB,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EAAEA,KAAK,CAACK,QAAS;MAAAD,QAAA,eACvCjB,IAAA,CAACN,aAAa;QAACU,KAAK,EAAEA,KAAM;QAAAa,QAAA,eAC1BjB,IAAA,CAACQ,SAAS;UACRqB,YAAY,EAAED,KAAK,CAACE,OAAQ;UAC5BC,aAAa,EAAEH,KAAK,CAACI,QAAS;UAC9BC,SAAS,EAAEL,KAAK,CAACM,UAAW;UAC5BC,UAAU,EAAEP,KAAK,CAACQ;QAAM,CACzB;MAAC,CACW;IAAC,CACC,CACrB,CAAC;IACDb,IAAI,EAAEb,aAAa,CAACC,MAAM;IAC1Be,KAAK,EAAE,EAAE;IACTrB;EACF,CAAC,CACH,CAAC;AACL,CAAC;AAED,eAAeJ,iBAAiB","ignoreList":[]}
1
+ {"version":3,"file":"renderSSRComplete.js","names":["renderToString","Provider","StaticRouter","Router","HelmetProvider","ServerStyleSheet","StyleSheetManager","createSSRComplete","htmlpage","getBasePath","ThemeProvider","ErrorBoundary","createHead","handleErrors","dehydrate","jsx","_jsx","renderSSRComplete","_ref","store","theme","UUID","requestHref","render","ErrorPage","template","helmetContext","helmet","routerContext","sheet","location","toLocation","basePath","children","instance","context","basename","then","appHTML","head","contextPath","html","state","catch","error","errorMessage","message","errorResource","fileName","errorLine","lineNumber","errorStack","stack"],"sources":["../../src/react-server/renderSSRComplete.js"],"sourcesContent":["// @flow\nimport { renderToString } from \"react-dom/server\";\nimport { Provider } from \"react-redux\";\nimport { StaticRouter as Router } from \"react-router\";\n\nimport { HelmetProvider } from \"react-helmet-async\";\n\nimport { ServerStyleSheet, StyleSheetManager } from \"styled-components\";\n\nimport createSSRComplete from \"./createSSRComplete\";\nimport htmlpage from \"./htmlpage\";\n\nimport { getBasePath } from \"../constants/Settings\";\n\nimport ThemeProvider from \"../react-theme/ThemeProvider\";\nimport ErrorBoundary from \"../react/ErrorBoundary\";\n\nimport { createHead, handleErrors, dehydrate } from \"./serverUtil\";\n\nimport type { Theme } from \"../react-theme/types\";\nimport type { ReduxStore } from \"../redux/types\";\nimport type Href from \"../models/href/Href\";\nimport type { TemplateProps } from \"./htmlpage\";\nimport type { Location } from \"react-router\";\n\ntype Props = {\n store: ReduxStore,\n theme: Theme,\n UUID: string,\n requestHref: Href,\n render: Function,\n ErrorPage: any,\n template?: (TemplateProps) => string,\n};\n/**\n */\nconst renderSSRComplete = ({\n store,\n theme,\n UUID = \"\",\n requestHref,\n render,\n ErrorPage,\n template = htmlpage,\n}: Props): Promise<string> => {\n const helmetContext = { helmet: {} };\n const routerContext = {};\n\n const sheet = new ServerStyleSheet();\n\n // $FlowFixMe[incompatible-type]\n // $FlowFixMe[prop-missing]\n const location: Location = requestHref.toLocation();\n\n const basePath = getBasePath();\n\n return createSSRComplete(store, () =>\n renderToString(\n <Provider store={store}>\n <StyleSheetManager sheet={sheet.instance}>\n <ThemeProvider theme={theme}>\n <HelmetProvider context={helmetContext}>\n <ErrorBoundary>\n <Router\n basename={basePath}\n location={location}\n context={routerContext}\n >\n {render()}\n </Router>\n </ErrorBoundary>\n </HelmetProvider>\n </ThemeProvider>\n </StyleSheetManager>\n </Provider>,\n ),\n )\n .then((appHTML) => {\n handleErrors(store);\n const head = createHead(sheet, UUID, helmetContext);\n return template({\n contextPath: basePath,\n html: appHTML,\n head,\n state: dehydrate(store),\n UUID,\n });\n })\n .catch((error) =>\n template({\n contextPath: basePath,\n html: renderToString(\n <StyleSheetManager sheet={sheet.instance}>\n <ThemeProvider theme={theme}>\n <ErrorPage\n errorMessage={error.message}\n errorResource={error.fileName}\n errorLine={error.lineNumber}\n errorStack={error.stack}\n />\n </ThemeProvider>\n </StyleSheetManager>,\n ),\n head: helmetContext.helmet,\n state: \"\",\n UUID,\n }),\n );\n};\n\nexport default renderSSRComplete;\n"],"mappings":"AACA,SAASA,cAAc,QAAQ,kBAAkB;AACjD,SAASC,QAAQ,QAAQ,aAAa;AACtC,SAASC,YAAY,IAAIC,MAAM,QAAQ,cAAc;AAErD,SAASC,cAAc,QAAQ,oBAAoB;AAE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A,QAAS;cACnBK,OAAO,EAAEP,aAAc;cAAAK,QAAA,EAEtBV,MAAM,CAAC;YAAC,CACH;UAAC,CACI;QAAC,CACF;MAAC,CACJ;IAAC,CACC;EAAC,CACZ,CACZ,CACF,CAAC,CACEc,IAAI,CAAEC,OAAO,IAAK;IACjBzB,YAAY,CAACM,KAAK,CAAC;IACnB,MAAMoB,IAAI,GAAG3B,UAAU,CAACiB,KAAK,EAAER,IAAI,EAAEK,aAAa,CAAC;IACnD,OAAOD,QAAQ,CAAC;MACde,WAAW,EAAER,QAAQ;MACrBS,IAAI,EAAEH,OAAO;MACbC,IAAI;MACJG,KAAK,EAAE5B,SAAS,CAACK,KAAK,CAAC;MACvBE;IACF,CAAC,CAAC;EACJ,CAAC,CAAC,CACDsB,KAAK,CAAEC,KAAK,IACXnB,QAAQ,CAAC;IACPe,WAAW,EAAER,QAAQ;IACrBS,IAAI,EAAEzC,cAAc,cAClBgB,IAAA,CAACV,iBAAiB;MAACuB,KAAK,EAAEA,KAAK,CAACK,QAAS;MAAAD,QAAA,eACvCjB,IAAA,CAACN,aAAa;QAACU,KAAK,EAAEA,KAAM;QAAAa,QAAA,eAC1BjB,IAAA,CAACQ,SAAS;UACRqB,YAAY,EAAED,KAAK,CAACE,OAAQ;UAC5BC,aAAa,EAAEH,KAAK,CAACI,QAAS;UAC9BC,SAAS,EAAEL,KAAK,CAACM,UAAW;UAC5BC,UAAU,EAAEP,KAAK,CAACQ;QAAM,CACzB;MAAC,CACW;IAAC,CACC,CACrB,CAAC;IACDb,IAAI,EAAEb,aAAa,CAACC,MAAM;IAC1Be,KAAK,EAAE,EAAE;IACTrB;EACF,CAAC,CACH,CAAC;AACL,CAAC;AAED,eAAeJ,iBAAiB","ignoreList":[]}
@@ -17,7 +17,7 @@ const renderSSRMinimal = _ref => {
17
17
  template = htmlpage
18
18
  } = _ref;
19
19
  const sheet = new ServerStyleSheet();
20
- const appHTML = renderToString( /*#__PURE__*/_jsx(Provider, {
20
+ const appHTML = renderToString(/*#__PURE__*/_jsx(Provider, {
21
21
  store: store,
22
22
  children: /*#__PURE__*/_jsx(StyleSheetManager, {
23
23
  sheet: sheet.instance,
@@ -1 +1 @@
1
- {"version":3,"file":"renderSSRMinimal.js","names":["renderToString","Provider","ServerStyleSheet","StyleSheetManager","ThemeProvider","getBasePath","createHead","dehydrate","htmlpage","jsx","_jsx","renderSSRMinimal","_ref","store","theme","UUID","render","template","sheet","appHTML","children","instance","head","contextPath","html","state"],"sources":["../../src/react-server/renderSSRMinimal.js"],"sourcesContent":["// @flow\nimport { renderToString } from \"react-dom/server\";\n\nimport { Provider } from \"react-redux\";\n\nimport { ServerStyleSheet, StyleSheetManager } from \"styled-components\";\nimport ThemeProvider from \"../react-theme/ThemeProvider\";\n\nimport { getBasePath } from \"../constants/Settings\";\n\nimport { createHead, dehydrate } from \"./serverUtil\";\nimport htmlpage from \"./htmlpage\";\n\nimport type { Theme } from \"../react-theme/types\";\nimport type { ReduxStore } from \"../redux/types\";\nimport type { TemplateProps } from \"./htmlpage\";\ntype Props = {\n store: ReduxStore,\n theme?: Theme | Array<Theme>,\n UUID: string,\n render: Function,\n template?: (TemplateProps) => string,\n};\n\n/**\n */\nconst renderSSRMinimal = ({\n store,\n theme,\n UUID = \"\",\n render,\n template = htmlpage,\n}: Props): string => {\n const sheet = new ServerStyleSheet();\n\n const appHTML = renderToString(\n <Provider store={store}>\n <StyleSheetManager sheet={sheet.instance}>\n <ThemeProvider theme={theme}>{render()}</ThemeProvider>\n </StyleSheetManager>\n </Provider>,\n );\n\n const head = createHead(sheet, UUID);\n return template({\n contextPath: getBasePath(),\n html: appHTML,\n head,\n state: dehydrate(store),\n UUID,\n });\n};\n\nexport default renderSSRMinimal;\n"],"mappings":"AACA,SAASA,cAAc,QAAQ,kBAAkB;AAEjD,SAASC,QAAQ,QAAQ,aAAa;AAEtC,SAASC,gBAAgB,EAAEC,iBAAiB,QAAQ,mBAAmB;AACvE,OAAOC,aAAa,MAAM,8BAA8B;AAExD,SAASC,WAAW,QAAQ,uBAAuB;AAEnD,SAASC,UAAU,EAAEC,SAAS,QAAQ,cAAc;AACpD,OAAOC,QAAQ,MAAM,YAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAalC;AACA;AACA,MAAMC,gBAAgB,GAAGC,IAAA,IAMJ;EAAA,IANK;IACxBC,KAAK;IACLC,KAAK;IACLC,IAAI,GAAG,EAAE;IACTC,MAAM;IACNC,QAAQ,GAAGT;EACN,CAAC,GAAAI,IAAA;EACN,MAAMM,KAAK,GAAG,IAAIhB,gBAAgB,CAAC,CAAC;EAEpC,MAAMiB,OAAO,GAAGnB,cAAc,eAC5BU,IAAA,CAACT,QAAQ;IAACY,KAAK,EAAEA,KAAM;IAAAO,QAAA,eACrBV,IAAA,CAACP,iBAAiB;MAACe,KAAK,EAAEA,KAAK,CAACG,QAAS;MAAAD,QAAA,eACvCV,IAAA,CAACN,aAAa;QAACU,KAAK,EAAEA,KAAM;QAAAM,QAAA,EAAEJ,MAAM,CAAC;MAAC,CAAgB;IAAC,CACtC;EAAC,CACZ,CACZ,CAAC;EAED,MAAMM,IAAI,GAAGhB,UAAU,CAACY,KAAK,EAAEH,IAAI,CAAC;EACpC,OAAOE,QAAQ,CAAC;IACdM,WAAW,EAAElB,WAAW,CAAC,CAAC;IAC1BmB,IAAI,EAAEL,OAAO;IACbG,IAAI;IACJG,KAAK,EAAElB,SAAS,CAACM,KAAK,CAAC;IACvBE;EACF,CAAC,CAAC;AACJ,CAAC;AAED,eAAeJ,gBAAgB","ignoreList":[]}
1
+ {"version":3,"file":"renderSSRMinimal.js","names":["renderToString","Provider","ServerStyleSheet","StyleSheetManager","ThemeProvider","getBasePath","createHead","dehydrate","htmlpage","jsx","_jsx","renderSSRMinimal","_ref","store","theme","UUID","render","template","sheet","appHTML","children","instance","head","contextPath","html","state"],"sources":["../../src/react-server/renderSSRMinimal.js"],"sourcesContent":["// @flow\nimport { renderToString } from \"react-dom/server\";\n\nimport { Provider } from \"react-redux\";\n\nimport { ServerStyleSheet, StyleSheetManager } from \"styled-components\";\nimport ThemeProvider from \"../react-theme/ThemeProvider\";\n\nimport { getBasePath } from \"../constants/Settings\";\n\nimport { createHead, dehydrate } from \"./serverUtil\";\nimport htmlpage from \"./htmlpage\";\n\nimport type { Theme } from \"../react-theme/types\";\nimport type { ReduxStore } from \"../redux/types\";\nimport type { TemplateProps } from \"./htmlpage\";\ntype Props = {\n store: ReduxStore,\n theme?: Theme | Array<Theme>,\n UUID: string,\n render: Function,\n template?: (TemplateProps) => string,\n};\n\n/**\n */\nconst renderSSRMinimal = ({\n store,\n theme,\n UUID = \"\",\n render,\n template = htmlpage,\n}: Props): string => {\n const sheet = new ServerStyleSheet();\n\n const appHTML = renderToString(\n <Provider store={store}>\n <StyleSheetManager sheet={sheet.instance}>\n <ThemeProvider theme={theme}>{render()}</ThemeProvider>\n </StyleSheetManager>\n </Provider>,\n );\n\n const head = createHead(sheet, UUID);\n return template({\n contextPath: getBasePath(),\n html: appHTML,\n head,\n state: dehydrate(store),\n UUID,\n });\n};\n\nexport default renderSSRMinimal;\n"],"mappings":"AACA,SAASA,cAAc,QAAQ,kBAAkB;AAEjD,SAASC,QAAQ,QAAQ,aAAa;AAEtC,SAASC,gBAAgB,EAAEC,iBAAiB,QAAQ,mBAAmB;AACvE,OAAOC,aAAa,MAAM,8BAA8B;AAExD,SAASC,WAAW,QAAQ,uBAAuB;AAEnD,SAASC,UAAU,EAAEC,SAAS,QAAQ,cAAc;AACpD,OAAOC,QAAQ,MAAM,YAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAalC;AACA;AACA,MAAMC,gBAAgB,GAAGC,IAAA,IAMJ;EAAA,IANK;IACxBC,KAAK;IACLC,KAAK;IACLC,IAAI,GAAG,EAAE;IACTC,MAAM;IACNC,QAAQ,GAAGT;EACN,CAAC,GAAAI,IAAA;EACN,MAAMM,KAAK,GAAG,IAAIhB,gBAAgB,CAAC,CAAC;EAEpC,MAAMiB,OAAO,GAAGnB,cAAc,cAC5BU,IAAA,CAACT,QAAQ;IAACY,KAAK,EAAEA,KAAM;IAAAO,QAAA,eACrBV,IAAA,CAACP,iBAAiB;MAACe,KAAK,EAAEA,KAAK,CAACG,QAAS;MAAAD,QAAA,eACvCV,IAAA,CAACN,aAAa;QAACU,KAAK,EAAEA,KAAM;QAAAM,QAAA,EAAEJ,MAAM,CAAC;MAAC,CAAgB;IAAC,CACtC;EAAC,CACZ,CACZ,CAAC;EAED,MAAMM,IAAI,GAAGhB,UAAU,CAACY,KAAK,EAAEH,IAAI,CAAC;EACpC,OAAOE,QAAQ,CAAC;IACdM,WAAW,EAAElB,WAAW,CAAC,CAAC;IAC1BmB,IAAI,EAAEL,OAAO;IACbG,IAAI;IACJG,KAAK,EAAElB,SAAS,CAACM,KAAK,CAAC;IACvBE;EACF,CAAC,CAAC;AACJ,CAAC;AAED,eAAeJ,gBAAgB","ignoreList":[]}
@@ -4,6 +4,7 @@ import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
4
4
  import _findInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/find";
5
5
  import _startsWithInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/starts-with";
6
6
  import _JSON$stringify from "@babel/runtime-corejs3/core-js-stable/json/stringify";
7
+ import _Object$values from "@babel/runtime-corejs3/core-js-stable/object/values";
7
8
  import { createSelectorCreator, defaultMemoize } from "reselect";
8
9
  import { has } from "../../utils/helpers/objects";
9
10
  import Href from "../../models/href/Href";
@@ -237,4 +238,14 @@ export const getModelsByType = (state, type) => {
237
238
  }
238
239
  return [];
239
240
  };
241
+
242
+ /**
243
+ */
244
+ export const getAllFinishedModels = state => {
245
+ if (state && state.modularui) {
246
+ var _context10, _context11;
247
+ return _mapInstanceProperty(_context10 = _filterInstanceProperty(_context11 = _Object$values(state.modularui)).call(_context11, entry => entry.status === "FINISHED")).call(_context10, entry => entry.model);
248
+ }
249
+ return [];
250
+ };
240
251
  //# sourceMappingURL=ModularUISelectors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ModularUISelectors.js","names":["createSelectorCreator","defaultMemoize","has","Href","ContentModel","ContentTOCModel","ApplicationModel","TabModel","CaseViewModel","FormModel","getAllModelsByInstance","state","instance","locale","i18n","modularui","_context","_context2","_mapInstanceProperty","_filterInstanceProperty","_Object$keys","call","key","model","getFirstModelByInstance","_context3","_findInstanceProperty","getActiveModelByInstance","location","getLocation","_context4","_startsWithInstanceProperty","selfhref","path","getApplication","getTab","getCaseView","getForm","modelByHref","href","_context5","findHref","modelConfigKey","equals","keyByHref","_context6","allKeysByHref","_context7","router","pathname","getModels","models","forEach","modelKey","modelEntry","label","type","modelInfo","selfContentLink","push","getActiveModels","value","other","_JSON$stringify","contextModels","locationParts","split","reduce","accumulator","current","comparePath","decodeURIComponent","replace","foundEntry","encodedHref","toString","getPreference","preferenceName","preferences","getModelsByType","_context8","_context9"],"sources":["../../../src/redux/_modularui/ModularUISelectors.js"],"sourcesContent":["// @flow\nimport { createSelectorCreator, defaultMemoize } from \"reselect\";\nimport { has } from \"../../utils/helpers/objects\";\n\nimport Href from \"../../models/href/Href\";\nimport ContentModel from \"../../models/content/ContentModel\";\nimport ContentTOCModel from \"../../models/content/ContentTOCModel\";\nimport ApplicationModel from \"../../models/application/ApplicationModel\";\nimport TabModel from \"../../models/tab/TabModel\";\nimport CaseViewModel from \"../../models/caseview/CaseViewModel\";\nimport FormModel from \"../../models/form/FormModel\";\n\nimport type { ReduxState, PreferenceValue } from \"../types\";\nimport type { ModularUIModel } from \"../../models/types\";\n\n/**\n */\nexport const getAllModelsByInstance = <T>(\n state: ReduxState,\n instance: Class<T>,\n): Array<ModularUIModel> => {\n const locale = state?.i18n?.locale || \"en\";\n const modularui = state?.modularui;\n\n if (modularui) {\n return Object.keys(modularui)\n .filter((key) => {\n const { model } = modularui[key];\n return model instanceof instance && model.locale === locale;\n })\n .map((key) => modularui[key].model);\n }\n\n return [];\n};\n\n/**\n */\nexport const getFirstModelByInstance = <T>(\n state: ReduxState,\n instance: Class<T>,\n): T | null => {\n const locale = state?.i18n?.locale || \"en\";\n const modularui = state?.modularui;\n\n if (modularui) {\n const key = Object.keys(modularui).find((key) => {\n const { model } = modularui[key];\n return model instanceof instance && model.locale === locale;\n });\n\n if (key) {\n const { model } = modularui[key];\n if (model instanceof instance) {\n return model;\n }\n }\n }\n\n return null;\n};\n\n/**\n */\nexport const getActiveModelByInstance = <T>(\n state: ReduxState,\n instance: Class<T>,\n): T | null => {\n const location = getLocation(state);\n\n const locale = state?.i18n?.locale || \"en\";\n const modularui = state?.modularui;\n\n if (modularui) {\n const key = Object.keys(modularui).find((key) => {\n const { model } = modularui[key];\n return (\n model instanceof instance &&\n model.locale === locale &&\n location.startsWith(model.selfhref.path)\n );\n });\n\n if (key) {\n const { model } = modularui[key];\n if (model instanceof instance) {\n return model;\n }\n }\n }\n\n return null;\n};\n\n/**\n * Get the application model, which is the model with selfhref '/'\n */\nexport const getApplication = (state: ReduxState): null | ApplicationModel =>\n getFirstModelByInstance(state, ApplicationModel);\n\n/**\n */\nexport const getTab = (state: ReduxState): null | TabModel =>\n getFirstModelByInstance(state, TabModel);\n\n/**\n */\nexport const getCaseView = (state: ReduxState): null | CaseViewModel =>\n getFirstModelByInstance(state, CaseViewModel);\n\n/**\n */\nexport const getForm = (state: ReduxState): null | FormModel =>\n getFirstModelByInstance(state, FormModel);\n\n/**\n * Get the model by it's href\n */\nexport const modelByHref = (\n state: ReduxState,\n href: Href | string,\n): null | ModularUIModel => {\n if (state && state.modularui) {\n const findHref = href instanceof Href ? href : new Href(href);\n\n const modelConfigKey = Object.keys(state.modularui).find((key) => {\n const model = state.modularui[key];\n\n return (\n model.model &&\n model.model.selfhref &&\n model.model.selfhref.equals(findHref)\n );\n });\n\n if (modelConfigKey) {\n return state.modularui[modelConfigKey].model;\n }\n }\n\n return null;\n};\n\n/**\n * Return the key of a model by the selfhref the model is saved in the reducer\n */\nexport const keyByHref = (state: ReduxState, href: Href | string): ?string => {\n if (state && state.modularui) {\n const findHref = href instanceof Href ? href : new Href(href);\n\n return Object.keys(state.modularui).find((key) => {\n const { model } = state.modularui[key];\n return model && model.selfhref && model.selfhref.equals(findHref);\n });\n }\n\n return null;\n};\n\n/**\n * Returns all model keys found in the store, restrict on href\n */\nexport const allKeysByHref = (\n state: ReduxState,\n href: Href | string,\n): Array<string> => {\n if (state && state.modularui) {\n const findHref = href instanceof Href ? href : new Href(href);\n\n return Object.keys(state.modularui).filter((key) => {\n const { model } = state.modularui[key];\n return model && model.selfhref && model.selfhref.equals(findHref);\n });\n }\n\n return [];\n};\n\n/**\n */\nconst getLocation = (state: ReduxState): string =>\n state?.router?.location.pathname;\n\n/**\n */\nconst getModels = (state: ReduxState) => {\n const models = [];\n\n Object.keys(state.modularui).forEach((modelKey: string) => {\n const modelEntry = state.modularui[modelKey];\n\n if (has(modelEntry, \"model\")) {\n const { key, selfhref, label, type } = modelEntry.model;\n\n const modelInfo = {\n key,\n selfhref,\n label,\n type,\n selfContentLink: null,\n };\n\n if (\n modelEntry.model instanceof ContentModel ||\n modelEntry.model instanceof ContentTOCModel\n ) {\n models.push({\n ...modelInfo,\n selfContentLink: modelEntry.model.selfContentLink,\n });\n } else {\n models.push(modelInfo);\n }\n }\n });\n\n return models;\n};\n\nexport const getActiveModels: (state: ReduxState) => Array<{\n key: string,\n href: Href,\n label: string,\n type: string,\n}> = createSelectorCreator(\n defaultMemoize,\n (value, other) => JSON.stringify(value) === JSON.stringify(other),\n)([getLocation, getModels], (location, models) => {\n const contextModels = [];\n\n if (location) {\n const locationParts = location.split(\"/\");\n\n locationParts.reduce((accumulator, current) => {\n const path = `${accumulator}/${current}`;\n\n // Remove modelcatalog part to match breadcrumb parts\n const comparePath = decodeURIComponent(path).replace(\n \"/modelcatalog/\",\n \"/\",\n );\n\n const foundEntry = models.find(\n (model) => model.selfhref && model.selfhref.equals(comparePath),\n );\n\n if (foundEntry) {\n const { key, label, type, selfhref, selfContentLink } = foundEntry;\n\n const href =\n path.startsWith(\"/modelcatalog/\") && selfContentLink\n ? new Href(`/modelcatalog${selfContentLink.encodedHref.toString()}`)\n : selfhref;\n\n contextModels.push({ key, href, label, type });\n }\n\n return path;\n });\n }\n\n return contextModels;\n});\n\n/**\n */\nexport const getPreference = (\n state: ReduxState,\n preferenceName: string,\n): null | PreferenceValue => {\n if (state && state.preferences) {\n return state.preferences[preferenceName];\n }\n\n return null;\n};\n\n/**\n * @deprecated - Use getFirstModelByInstance or the appropriate getter for the model type: getApplication, getTab, etc\n */\nexport const getModelsByType = (\n state: ReduxState,\n type: string,\n): Array<ModularUIModel> => {\n if (state && state.modularui) {\n return Object.keys(state.modularui)\n .filter(\n (key) =>\n state.modularui[key] &&\n state.modularui[key].model &&\n state.modularui[key].model.type === type,\n )\n .map((key) => state.modularui[key].model);\n }\n\n return [];\n};\n"],"mappings":";;;;;;AACA,SAASA,qBAAqB,EAAEC,cAAc,QAAQ,UAAU;AAChE,SAASC,GAAG,QAAQ,6BAA6B;AAEjD,OAAOC,IAAI,MAAM,wBAAwB;AACzC,OAAOC,YAAY,MAAM,mCAAmC;AAC5D,OAAOC,eAAe,MAAM,sCAAsC;AAClE,OAAOC,gBAAgB,MAAM,2CAA2C;AACxE,OAAOC,QAAQ,MAAM,2BAA2B;AAChD,OAAOC,aAAa,MAAM,qCAAqC;AAC/D,OAAOC,SAAS,MAAM,6BAA6B;AAKnD;AACA;AACA,OAAO,MAAMC,sBAAsB,GAAGA,CACpCC,KAAiB,EACjBC,QAAkB,KACQ;EAC1B,MAAMC,MAAM,GAAGF,KAAK,EAAEG,IAAI,EAAED,MAAM,IAAI,IAAI;EAC1C,MAAME,SAAS,GAAGJ,KAAK,EAAEI,SAAS;EAElC,IAAIA,SAAS,EAAE;IAAA,IAAAC,QAAA,EAAAC,SAAA;IACb,OAAOC,oBAAA,CAAAF,QAAA,GAAAG,uBAAA,CAAAF,SAAA,GAAAG,YAAA,CAAYL,SAAS,CAAC,EAAAM,IAAA,CAAAJ,SAA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,EAAE;AACX,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"ModularUISelectors.js","names":["createSelectorCreator","defaultMemoize","has","Href","ContentModel","ContentTOCModel","ApplicationModel","TabModel","CaseViewModel","FormModel","getAllModelsByInstance","state","instance","locale","i18n","modularui","_context","_context2","_mapInstanceProperty","_filterInstanceProperty","_Object$keys","call","key","model","getFirstModelByInstance","_context3","_findInstanceProperty","getActiveModelByInstance","location","getLocation","_context4","_startsWithInstanceProperty","selfhref","path","getApplication","getTab","getCaseView","getForm","modelByHref","href","_context5","findHref","modelConfigKey","equals","keyByHref","_context6","allKeysByHref","_context7","router","pathname","getModels","models","forEach","modelKey","modelEntry","label","type","modelInfo","selfContentLink","push","getActiveModels","value","other","_JSON$stringify","contextModels","locationParts","split","reduce","accumulator","current","comparePath","decodeURIComponent","replace","foundEntry","encodedHref","toString","getPreference","preferenceName","preferences","getModelsByType","_context8","_context9","getAllFinishedModels","_context10","_context11","_Object$values","entry","status"],"sources":["../../../src/redux/_modularui/ModularUISelectors.js"],"sourcesContent":["// @flow\nimport { createSelectorCreator, defaultMemoize } from \"reselect\";\nimport { has } from \"../../utils/helpers/objects\";\n\nimport Href from \"../../models/href/Href\";\nimport ContentModel from \"../../models/content/ContentModel\";\nimport ContentTOCModel from \"../../models/content/ContentTOCModel\";\nimport ApplicationModel from \"../../models/application/ApplicationModel\";\nimport TabModel from \"../../models/tab/TabModel\";\nimport CaseViewModel from \"../../models/caseview/CaseViewModel\";\nimport FormModel from \"../../models/form/FormModel\";\n\nimport type { ReduxState, PreferenceValue } from \"../types\";\nimport type { ModularUIModel } from \"../../models/types\";\n\n/**\n */\nexport const getAllModelsByInstance = <T>(\n state: ReduxState,\n instance: Class<T>,\n): Array<ModularUIModel> => {\n const locale = state?.i18n?.locale || \"en\";\n const modularui = state?.modularui;\n\n if (modularui) {\n return Object.keys(modularui)\n .filter((key) => {\n const { model } = modularui[key];\n return model instanceof instance && model.locale === locale;\n })\n .map((key) => modularui[key].model);\n }\n\n return [];\n};\n\n/**\n */\nexport const getFirstModelByInstance = <T>(\n state: ReduxState,\n instance: Class<T>,\n): T | null => {\n const locale = state?.i18n?.locale || \"en\";\n const modularui = state?.modularui;\n\n if (modularui) {\n const key = Object.keys(modularui).find((key) => {\n const { model } = modularui[key];\n return model instanceof instance && model.locale === locale;\n });\n\n if (key) {\n const { model } = modularui[key];\n if (model instanceof instance) {\n return model;\n }\n }\n }\n\n return null;\n};\n\n/**\n */\nexport const getActiveModelByInstance = <T>(\n state: ReduxState,\n instance: Class<T>,\n): T | null => {\n const location = getLocation(state);\n\n const locale = state?.i18n?.locale || \"en\";\n const modularui = state?.modularui;\n\n if (modularui) {\n const key = Object.keys(modularui).find((key) => {\n const { model } = modularui[key];\n return (\n model instanceof instance &&\n model.locale === locale &&\n location.startsWith(model.selfhref.path)\n );\n });\n\n if (key) {\n const { model } = modularui[key];\n if (model instanceof instance) {\n return model;\n }\n }\n }\n\n return null;\n};\n\n/**\n * Get the application model, which is the model with selfhref '/'\n */\nexport const getApplication = (state: ReduxState): null | ApplicationModel =>\n getFirstModelByInstance(state, ApplicationModel);\n\n/**\n */\nexport const getTab = (state: ReduxState): null | TabModel =>\n getFirstModelByInstance(state, TabModel);\n\n/**\n */\nexport const getCaseView = (state: ReduxState): null | CaseViewModel =>\n getFirstModelByInstance(state, CaseViewModel);\n\n/**\n */\nexport const getForm = (state: ReduxState): null | FormModel =>\n getFirstModelByInstance(state, FormModel);\n\n/**\n * Get the model by it's href\n */\nexport const modelByHref = (\n state: ReduxState,\n href: Href | string,\n): null | ModularUIModel => {\n if (state && state.modularui) {\n const findHref = href instanceof Href ? href : new Href(href);\n\n const modelConfigKey = Object.keys(state.modularui).find((key) => {\n const model = state.modularui[key];\n\n return (\n model.model &&\n model.model.selfhref &&\n model.model.selfhref.equals(findHref)\n );\n });\n\n if (modelConfigKey) {\n return state.modularui[modelConfigKey].model;\n }\n }\n\n return null;\n};\n\n/**\n * Return the key of a model by the selfhref the model is saved in the reducer\n */\nexport const keyByHref = (state: ReduxState, href: Href | string): ?string => {\n if (state && state.modularui) {\n const findHref = href instanceof Href ? href : new Href(href);\n\n return Object.keys(state.modularui).find((key) => {\n const { model } = state.modularui[key];\n return model && model.selfhref && model.selfhref.equals(findHref);\n });\n }\n\n return null;\n};\n\n/**\n * Returns all model keys found in the store, restrict on href\n */\nexport const allKeysByHref = (\n state: ReduxState,\n href: Href | string,\n): Array<string> => {\n if (state && state.modularui) {\n const findHref = href instanceof Href ? href : new Href(href);\n\n return Object.keys(state.modularui).filter((key) => {\n const { model } = state.modularui[key];\n return model && model.selfhref && model.selfhref.equals(findHref);\n });\n }\n\n return [];\n};\n\n/**\n */\nconst getLocation = (state: ReduxState): string =>\n state?.router?.location.pathname;\n\n/**\n */\nconst getModels = (state: ReduxState) => {\n const models = [];\n\n Object.keys(state.modularui).forEach((modelKey: string) => {\n const modelEntry = state.modularui[modelKey];\n\n if (has(modelEntry, \"model\")) {\n const { key, selfhref, label, type } = modelEntry.model;\n\n const modelInfo = {\n key,\n selfhref,\n label,\n type,\n selfContentLink: null,\n };\n\n if (\n modelEntry.model instanceof ContentModel ||\n modelEntry.model instanceof ContentTOCModel\n ) {\n models.push({\n ...modelInfo,\n selfContentLink: modelEntry.model.selfContentLink,\n });\n } else {\n models.push(modelInfo);\n }\n }\n });\n\n return models;\n};\n\nexport const getActiveModels: (state: ReduxState) => Array<{\n key: string,\n href: Href,\n label: string,\n type: string,\n}> = createSelectorCreator(\n defaultMemoize,\n (value, other) => JSON.stringify(value) === JSON.stringify(other),\n)([getLocation, getModels], (location, models) => {\n const contextModels = [];\n\n if (location) {\n const locationParts = location.split(\"/\");\n\n locationParts.reduce((accumulator, current) => {\n const path = `${accumulator}/${current}`;\n\n // Remove modelcatalog part to match breadcrumb parts\n const comparePath = decodeURIComponent(path).replace(\n \"/modelcatalog/\",\n \"/\",\n );\n\n const foundEntry = models.find(\n (model) => model.selfhref && model.selfhref.equals(comparePath),\n );\n\n if (foundEntry) {\n const { key, label, type, selfhref, selfContentLink } = foundEntry;\n\n const href =\n path.startsWith(\"/modelcatalog/\") && selfContentLink\n ? new Href(`/modelcatalog${selfContentLink.encodedHref.toString()}`)\n : selfhref;\n\n contextModels.push({ key, href, label, type });\n }\n\n return path;\n });\n }\n\n return contextModels;\n});\n\n/**\n */\nexport const getPreference = (\n state: ReduxState,\n preferenceName: string,\n): null | PreferenceValue => {\n if (state && state.preferences) {\n return state.preferences[preferenceName];\n }\n\n return null;\n};\n\n/**\n * @deprecated - Use getFirstModelByInstance or the appropriate getter for the model type: getApplication, getTab, etc\n */\nexport const getModelsByType = (\n state: ReduxState,\n type: string,\n): Array<ModularUIModel> => {\n if (state && state.modularui) {\n return Object.keys(state.modularui)\n .filter(\n (key) =>\n state.modularui[key] &&\n state.modularui[key].model &&\n state.modularui[key].model.type === type,\n )\n .map((key) => state.modularui[key].model);\n }\n\n return [];\n};\n\n/**\n */\nexport const getAllFinishedModels = (\n state: ReduxState,\n): Array<ModularUIModel> => {\n if (state && state.modularui) {\n return Object.values(state.modularui)\n .filter((entry) => entry.status === \"FINISHED\")\n .map((entry) => entry.model);\n }\n return [];\n};\n"],"mappings":";;;;;;;AACA,SAASA,qBAAqB,EAAEC,cAAc,QAAQ,UAAU;AAChE,SAASC,GAAG,QAAQ,6BAA6B;AAEjD,OAAOC,IAAI,MAAM,wBAAwB;AACzC,OAAOC,YAAY,MAAM,mCAAmC;AAC5D,OAAOC,eAAe,MAAM,sCAAsC;AAClE,OAAOC,gBAAgB,MAAM,2CAA2C;AACxE,OAAOC,QAAQ,MAAM,2BAA2B;AAChD,OAAOC,aAAa,MAAM,qCAAqC;AAC/D,OAAOC,SAAS,MAAM,6BAA6B;AAKnD;AACA;AACA,OAAO,MAAMC,sBAAsB,GAAGA,CACpCC,KAAiB,EACjBC,QAAkB,KACQ;EAC1B,MAAMC,MAAM,GAAGF,KAAK,EAAEG,IAAI,EAAED,MAAM,IAAI,IAAI;EAC1C,MAAME,SAAS,GAAG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K,CAACI,SAAS,CAACO,GAAG,CAAC,CAACC,KAAK,CAACiC,IAAI,KAAKA,IACxC,CAAC,EAAAnC,IAAA,CAAA2D,SAAA,EACK1D,GAAG,IAAKX,KAAK,CAACI,SAAS,CAACO,GAAG,CAAC,CAACC,KAAK,CAAC;EAC7C;EAEA,OAAO,EAAE;AACX,CAAC;;AAED;AACA;AACA,OAAO,MAAM2D,oBAAoB,GAC/BvE,KAAiB,IACS;EAC1B,IAAIA,KAAK,IAAIA,KAAK,CAACI,SAAS,EAAE;IAAA,IAAAoE,UAAA,EAAAC,UAAA;IAC5B,OAAOlE,oBAAA,CAAAiE,UAAA,GAAAhE,uBAAA,CAAAiE,UAAA,GAAAC,cAAA,CAAc1E,KAAK,CAACI,SAAS,CAAC,EAAAM,IAAA,CAAA+D,UAAA,EAC1BE,KAAK,IAAKA,KAAK,CAACC,MAAM,KAAK,UAAU,CAAC,EAAAlE,IAAA,CAAA8D,UAAA,EACzCG,KAAK,IAAKA,KAAK,CAAC/D,KAAK,CAAC;EAChC;EACA,OAAO,EAAE;AACX,CAAC","ignoreList":[]}
@@ -11,7 +11,7 @@ var _ModelCategoryModel = _interopRequireDefault(require("./ModelCategoryModel")
11
11
  /**
12
12
  * Model category collection
13
13
  */
14
- class SourceReferenceCollection extends _BaseCollection.default {
14
+ class ModelCategoryCollection extends _BaseCollection.default {
15
15
  /**
16
16
  */
17
17
  constructor() {
@@ -20,5 +20,5 @@ class SourceReferenceCollection extends _BaseCollection.default {
20
20
  this.collection = modelCategories ? (0, _map.default)(modelCategories).call(modelCategories, modelCategory => new _ModelCategoryModel.default(modelCategory)) : [];
21
21
  }
22
22
  }
23
- exports.default = SourceReferenceCollection;
23
+ exports.default = ModelCategoryCollection;
24
24
  //# sourceMappingURL=ModelCategoryCollection.js.map
@@ -7,7 +7,7 @@ import type { ModelCategory } from "./ModelCategoryModel";
7
7
  /**
8
8
  * Model category collection
9
9
  */
10
- export default class SourceReferenceCollection extends BaseCollection<ModelCategoryModel> {
10
+ export default class ModelCategoryCollection extends BaseCollection<ModelCategoryModel> {
11
11
  /**
12
12
  */
13
13
  constructor(modelCategories: Array<ModelCategory> = []) {
@@ -1 +1 @@
1
- {"version":3,"file":"ModelCategoryCollection.js","names":["_BaseCollection","_interopRequireDefault","require","_ModelCategoryModel","SourceReferenceCollection","BaseCollection","constructor","modelCategories","arguments","length","undefined","collection","_map","default","call","modelCategory","ModelCategoryModel","exports"],"sources":["../../../src/models/modelcatalog/ModelCategoryCollection.js"],"sourcesContent":["// @flow\nimport BaseCollection from \"../base/BaseCollection\";\nimport ModelCategoryModel from \"./ModelCategoryModel\";\n\nimport type { ModelCategory } from \"./ModelCategoryModel\";\n\n/**\n * Model category collection\n */\nexport default class SourceReferenceCollection extends BaseCollection<ModelCategoryModel> {\n /**\n */\n constructor(modelCategories: Array<ModelCategory> = []) {\n super();\n\n this.collection = modelCategories\n ? modelCategories.map(\n (modelCategory) => new ModelCategoryModel(modelCategory),\n )\n : [];\n }\n}\n"],"mappings":";;;;;;;;AACA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAIA;AACA;AACA;AACe,MAAME,yBAAyB,SAASC,uBAAc,CAAqB;EACxF;AACF;EACEC,WAAWA,CAAA,EAA6C;IAAA,IAA5CC,eAAqC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;IACpD,KAAK,CAAC,CAAC;IAEP,IAAI,CAACG,UAAU,GAAGJ,eAAe,GAC7B,IAAAK,IAAA,CAAAC,OAAA,EAAAN,eAAe,EAAAO,IAAA,CAAfP,eAAe,EACZQ,aAAa,IAAK,IAAIC,2BAAkB,CAACD,aAAa,CACzD,CAAC,GACD,EAAE;EACR;AACF;AAACE,OAAA,CAAAJ,OAAA,GAAAT,yBAAA","ignoreList":[]}
1
+ {"version":3,"file":"ModelCategoryCollection.js","names":["_BaseCollection","_interopRequireDefault","require","_ModelCategoryModel","ModelCategoryCollection","BaseCollection","constructor","modelCategories","arguments","length","undefined","collection","_map","default","call","modelCategory","ModelCategoryModel","exports"],"sources":["../../../src/models/modelcatalog/ModelCategoryCollection.js"],"sourcesContent":["// @flow\nimport BaseCollection from \"../base/BaseCollection\";\nimport ModelCategoryModel from \"./ModelCategoryModel\";\n\nimport type { ModelCategory } from \"./ModelCategoryModel\";\n\n/**\n * Model category collection\n */\nexport default class ModelCategoryCollection extends BaseCollection<ModelCategoryModel> {\n /**\n */\n constructor(modelCategories: Array<ModelCategory> = []) {\n super();\n\n this.collection = modelCategories\n ? modelCategories.map(\n (modelCategory) => new ModelCategoryModel(modelCategory),\n )\n : [];\n }\n}\n"],"mappings":";;;;;;;;AACA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAIA;AACA;AACA;AACe,MAAME,uBAAuB,SAASC,uBAAc,CAAqB;EACtF;AACF;EACEC,WAAWA,CAAA,EAA6C;IAAA,IAA5CC,eAAqC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;IACpD,KAAK,CAAC,CAAC;IAEP,IAAI,CAACG,UAAU,GAAGJ,eAAe,GAC7B,IAAAK,IAAA,CAAAC,OAAA,EAAAN,eAAe,EAAAO,IAAA,CAAfP,eAAe,EACZQ,aAAa,IAAK,IAAIC,2BAAkB,CAACD,aAAa,CACzD,CAAC,GACD,EAAE;EACR;AACF;AAACE,OAAA,CAAAJ,OAAA,GAAAT,uBAAA","ignoreList":[]}
@@ -39,7 +39,7 @@ const renderSSRComplete = _ref => {
39
39
  // $FlowFixMe[prop-missing]
40
40
  const location = requestHref.toLocation();
41
41
  const basePath = (0, _Settings.getBasePath)();
42
- return (0, _createSSRComplete.default)(store, () => (0, _server.renderToString)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRedux.Provider, {
42
+ return (0, _createSSRComplete.default)(store, () => (0, _server.renderToString)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRedux.Provider, {
43
43
  store: store,
44
44
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledComponents.StyleSheetManager, {
45
45
  sheet: sheet.instance,
@@ -70,7 +70,7 @@ const renderSSRComplete = _ref => {
70
70
  });
71
71
  }).catch(error => template({
72
72
  contextPath: basePath,
73
- html: (0, _server.renderToString)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledComponents.StyleSheetManager, {
73
+ html: (0, _server.renderToString)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_styledComponents.StyleSheetManager, {
74
74
  sheet: sheet.instance,
75
75
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ThemeProvider.default, {
76
76
  theme: theme,
@@ -1 +1 @@
1
- {"version":3,"file":"renderSSRComplete.js","names":["_server","require","_reactRedux","_reactRouter","_reactHelmetAsync","_styledComponents","_createSSRComplete","_interopRequireDefault","_htmlpage","_Settings","_ThemeProvider","_ErrorBoundary","_serverUtil","_jsxRuntime","renderSSRComplete","_ref","store","theme","UUID","requestHref","render","ErrorPage","template","htmlpage","helmetContext","helmet","routerContext","sheet","ServerStyleSheet","location","toLocation","basePath","getBasePath","createSSRComplete","renderToString","jsx","Provider","children","StyleSheetManager","instance","default","HelmetProvider","context","StaticRouter","basename","then","appHTML","handleErrors","head","createHead","contextPath","html","state","dehydrate","catch","error","errorMessage","message","errorResource","fileName","errorLine","lineNumber","errorStack","stack","_default","exports"],"sources":["../../src/react-server/renderSSRComplete.js"],"sourcesContent":["// @flow\nimport { renderToString } from \"react-dom/server\";\nimport { Provider } from \"react-redux\";\nimport { StaticRouter as Router } from \"react-router\";\n\nimport { HelmetProvider } from \"react-helmet-async\";\n\nimport { ServerStyleSheet, StyleSheetManager } from \"styled-components\";\n\nimport createSSRComplete from \"./createSSRComplete\";\nimport htmlpage from \"./htmlpage\";\n\nimport { getBasePath } from \"../constants/Settings\";\n\nimport ThemeProvider from \"../react-theme/ThemeProvider\";\nimport ErrorBoundary from \"../react/ErrorBoundary\";\n\nimport { createHead, handleErrors, dehydrate } from \"./serverUtil\";\n\nimport type { Theme } from \"../react-theme/types\";\nimport type { ReduxStore } from \"../redux/types\";\nimport type Href from \"../models/href/Href\";\nimport type { TemplateProps } from \"./htmlpage\";\nimport type { Location } from \"react-router\";\n\ntype Props = {\n store: ReduxStore,\n theme: Theme,\n UUID: string,\n requestHref: Href,\n render: Function,\n ErrorPage: any,\n template?: (TemplateProps) => string,\n};\n/**\n */\nconst renderSSRComplete = ({\n store,\n theme,\n UUID = \"\",\n requestHref,\n render,\n ErrorPage,\n template = htmlpage,\n}: Props): Promise<string> => {\n const helmetContext = { helmet: {} };\n const routerContext = {};\n\n const sheet = new ServerStyleSheet();\n\n // $FlowFixMe[incompatible-type]\n // $FlowFixMe[prop-missing]\n const location: Location = requestHref.toLocation();\n\n const basePath = getBasePath();\n\n return createSSRComplete(store, () =>\n renderToString(\n <Provider store={store}>\n <StyleSheetManager sheet={sheet.instance}>\n <ThemeProvider theme={theme}>\n <HelmetProvider context={helmetContext}>\n <ErrorBoundary>\n <Router\n basename={basePath}\n location={location}\n context={routerContext}\n >\n {render()}\n </Router>\n </ErrorBoundary>\n </HelmetProvider>\n </ThemeProvider>\n </StyleSheetManager>\n </Provider>,\n ),\n )\n .then((appHTML) => {\n handleErrors(store);\n const head = createHead(sheet, UUID, helmetContext);\n return template({\n contextPath: basePath,\n html: appHTML,\n head,\n state: dehydrate(store),\n UUID,\n });\n })\n .catch((error) =>\n template({\n contextPath: basePath,\n html: renderToString(\n <StyleSheetManager sheet={sheet.instance}>\n <ThemeProvider theme={theme}>\n <ErrorPage\n errorMessage={error.message}\n errorResource={error.fileName}\n errorLine={error.lineNumber}\n errorStack={error.stack}\n />\n </ThemeProvider>\n </StyleSheetManager>,\n ),\n head: helmetContext.helmet,\n state: \"\",\n UUID,\n }),\n );\n};\n\nexport default render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QAAA,eAC1B,IAAAxB,WAAA,CAAAsB,GAAA,EAACd,SAAS;UACRmC,YAAY,EAAED,KAAK,CAACE,OAAQ;UAC5BC,aAAa,EAAEH,KAAK,CAACI,QAAS;UAC9BC,SAAS,EAAEL,KAAK,CAACM,UAAW;UAC5BC,UAAU,EAAEP,KAAK,CAACQ;QAAM,CACzB;MAAC,CACW;IAAC,CACC,CACrB,CAAC;IACDf,IAAI,EAAExB,aAAa,CAACC,MAAM;IAC1B2B,KAAK,EAAE,EAAE;IACTlC;EACF,CAAC,CACH,CAAC;AACL,CAAC;AAAC,IAAA8C,QAAA,GAAAC,OAAA,CAAAzB,OAAA,GAEa1B,iBAAiB","ignoreList":[]}
1
+ {"version":3,"file":"renderSSRComplete.js","names":["_server","require","_reactRedux","_reactRouter","_reactHelmetAsync","_styledComponents","_createSSRComplete","_interopRequireDefault","_htmlpage","_Settings","_ThemeProvider","_ErrorBoundary","_serverUtil","_jsxRuntime","renderSSRComplete","_ref","store","theme","UUID","requestHref","render","ErrorPage","template","htmlpage","helmetContext","helmet","routerContext","sheet","ServerStyleSheet","location","toLocation","basePath","getBasePath","createSSRComplete","renderToString","jsx","Provider","children","StyleSheetManager","instance","default","HelmetProvider","context","StaticRouter","basename","then","appHTML","handleErrors","head","createHead","contextPath","html","state","dehydrate","catch","error","errorMessage","message","errorResource","fileName","errorLine","lineNumber","errorStack","stack","_default","exports"],"sources":["../../src/react-server/renderSSRComplete.js"],"sourcesContent":["// @flow\nimport { renderToString } from \"react-dom/server\";\nimport { Provider } from \"react-redux\";\nimport { StaticRouter as Router } from \"react-router\";\n\nimport { HelmetProvider } from \"react-helmet-async\";\n\nimport { ServerStyleSheet, StyleSheetManager } from \"styled-components\";\n\nimport createSSRComplete from \"./createSSRComplete\";\nimport htmlpage from \"./htmlpage\";\n\nimport { getBasePath } from \"../constants/Settings\";\n\nimport ThemeProvider from \"../react-theme/ThemeProvider\";\nimport ErrorBoundary from \"../react/ErrorBoundary\";\n\nimport { createHead, handleErrors, dehydrate } from \"./serverUtil\";\n\nimport type { Theme } from \"../react-theme/types\";\nimport type { ReduxStore } from \"../redux/types\";\nimport type Href from \"../models/href/Href\";\nimport type { TemplateProps } from \"./htmlpage\";\nimport type { Location } from \"react-router\";\n\ntype Props = {\n store: ReduxStore,\n theme: Theme,\n UUID: string,\n requestHref: Href,\n render: Function,\n ErrorPage: any,\n template?: (TemplateProps) => string,\n};\n/**\n */\nconst renderSSRComplete = ({\n store,\n theme,\n UUID = \"\",\n requestHref,\n render,\n ErrorPage,\n template = htmlpage,\n}: Props): Promise<string> => {\n const helmetContext = { helmet: {} };\n const routerContext = {};\n\n const sheet = new ServerStyleSheet();\n\n // $FlowFixMe[incompatible-type]\n // $FlowFixMe[prop-missing]\n const location: Location = requestHref.toLocation();\n\n const basePath = getBasePath();\n\n return createSSRComplete(store, () =>\n renderToString(\n <Provider store={store}>\n <StyleSheetManager sheet={sheet.instance}>\n <ThemeProvider theme={theme}>\n <HelmetProvider context={helmetContext}>\n <ErrorBoundary>\n <Router\n basename={basePath}\n location={location}\n context={routerContext}\n >\n {render()}\n </Router>\n </ErrorBoundary>\n </HelmetProvider>\n </ThemeProvider>\n </StyleSheetManager>\n </Provider>,\n ),\n )\n .then((appHTML) => {\n handleErrors(store);\n const head = createHead(sheet, UUID, helmetContext);\n return template({\n contextPath: basePath,\n html: appHTML,\n head,\n state: dehydrate(store),\n UUID,\n });\n })\n .catch((error) =>\n template({\n contextPath: basePath,\n html: renderToString(\n <StyleSheetManager sheet={sheet.instance}>\n <ThemeProvider theme={theme}>\n <ErrorPage\n errorMessage={error.message}\n errorResource={error.fileName}\n errorLine={error.lineNumber}\n errorStack={error.stack}\n />\n </ThemeProvider>\n </StyleSheetManager>,\n ),\n head: helmetContext.helmet,\n state: \"\",\n UUID,\n }),\n );\n};\n\nexport default renderSSRComplete;\n"],"mappings":";;;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IA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,aAAa,EAAEH,KAAK,CAACI,QAAS;UAC9BC,SAAS,EAAEL,KAAK,CAACM,UAAW;UAC5BC,UAAU,EAAEP,KAAK,CAACQ;QAAM,CACzB;MAAC,CACW;IAAC,CACC,CACrB,CAAC;IACDf,IAAI,EAAExB,aAAa,CAACC,MAAM;IAC1B2B,KAAK,EAAE,EAAE;IACTlC;EACF,CAAC,CACH,CAAC;AACL,CAAC;AAAC,IAAA8C,QAAA,GAAAC,OAAA,CAAAzB,OAAA,GAEa1B,iBAAiB","ignoreList":[]}
@@ -24,7 +24,7 @@ const renderSSRMinimal = _ref => {
24
24
  template = _htmlpage.default
25
25
  } = _ref;
26
26
  const sheet = new _styledComponents.ServerStyleSheet();
27
- const appHTML = (0, _server.renderToString)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRedux.Provider, {
27
+ const appHTML = (0, _server.renderToString)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRedux.Provider, {
28
28
  store: store,
29
29
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledComponents.StyleSheetManager, {
30
30
  sheet: sheet.instance,
@@ -1 +1 @@
1
- {"version":3,"file":"renderSSRMinimal.js","names":["_server","require","_reactRedux","_styledComponents","_ThemeProvider","_interopRequireDefault","_Settings","_serverUtil","_htmlpage","_jsxRuntime","renderSSRMinimal","_ref","store","theme","UUID","render","template","htmlpage","sheet","ServerStyleSheet","appHTML","renderToString","jsx","Provider","children","StyleSheetManager","instance","default","head","createHead","contextPath","getBasePath","html","state","dehydrate","_default","exports"],"sources":["../../src/react-server/renderSSRMinimal.js"],"sourcesContent":["// @flow\nimport { renderToString } from \"react-dom/server\";\n\nimport { Provider } from \"react-redux\";\n\nimport { ServerStyleSheet, StyleSheetManager } from \"styled-components\";\nimport ThemeProvider from \"../react-theme/ThemeProvider\";\n\nimport { getBasePath } from \"../constants/Settings\";\n\nimport { createHead, dehydrate } from \"./serverUtil\";\nimport htmlpage from \"./htmlpage\";\n\nimport type { Theme } from \"../react-theme/types\";\nimport type { ReduxStore } from \"../redux/types\";\nimport type { TemplateProps } from \"./htmlpage\";\ntype Props = {\n store: ReduxStore,\n theme?: Theme | Array<Theme>,\n UUID: string,\n render: Function,\n template?: (TemplateProps) => string,\n};\n\n/**\n */\nconst renderSSRMinimal = ({\n store,\n theme,\n UUID = \"\",\n render,\n template = htmlpage,\n}: Props): string => {\n const sheet = new ServerStyleSheet();\n\n const appHTML = renderToString(\n <Provider store={store}>\n <StyleSheetManager sheet={sheet.instance}>\n <ThemeProvider theme={theme}>{render()}</ThemeProvider>\n </StyleSheetManager>\n </Provider>,\n );\n\n const head = createHead(sheet, UUID);\n return template({\n contextPath: getBasePath(),\n html: appHTML,\n head,\n state: dehydrate(store),\n UUID,\n });\n};\n\nexport default renderSSRMinimal;\n"],"mappings":";;;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,iBAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAEA,IAAAK,SAAA,GAAAL,OAAA;AAEA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAH,sBAAA,CAAAJ,OAAA;AAAkC,IAAAQ,WAAA,GAAAR,OAAA;AAalC;AACA;AACA,MAAMS,gBAAgB,GAAGC,IAAA,IAMJ;EAAA,IANK;IACxBC,KAAK;IACLC,KAAK;IACLC,IAAI,GAAG,EAAE;IACTC,MAAM;IACNC,QAAQ,GAAGC;EACN,CAAC,GAAAN,IAAA;EACN,MAAMO,KAAK,GAAG,IAAIC,kCAAgB,CAAC,CAAC;EAEpC,MAAMC,OAAO,GAAG,IAAAC,sBAAc,gBAC5B,IAAAZ,WAAA,CAAAa,GAAA,EAACpB,WAAA,CAAAqB,QAAQ;IAACX,KAAK,EAAEA,KAAM;IAAAY,QAAA,eACrB,IAAAf,WAAA,CAAAa,GAAA,EAACnB,iBAAA,CAAAsB,iBAAiB;MAACP,KAAK,EAAEA,KAAK,CAACQ,QAAS;MAAAF,QAAA,eACvC,IAAAf,WAAA,CAAAa,GAAA,EAAClB,cAAA,CAAAuB,OAAa;QAACd,KAAK,EAAEA,KAAM;QAAAW,QAAA,EAAET,MAAM,CAAC;MAAC,CAAgB;IAAC,CACtC;EAAC,CACZ,CACZ,CAAC;EAED,MAAMa,IAAI,GAAG,IAAAC,sBAAU,EAACX,KAAK,EAAEJ,IAAI,CAAC;EACpC,OAAOE,QAAQ,CAAC;IACdc,WAAW,EAAE,IAAAC,qBAAW,EAAC,CAAC;IAC1BC,IAAI,EAAEZ,OAAO;IACbQ,IAAI;IACJK,KAAK,EAAE,IAAAC,qBAAS,EAACtB,KAAK,CAAC;IACvBE;EACF,CAAC,CAAC;AACJ,CAAC;AAAC,IAAAqB,QAAA,GAAAC,OAAA,CAAAT,OAAA,GAEajB,gBAAgB","ignoreList":[]}
1
+ {"version":3,"file":"renderSSRMinimal.js","names":["_server","require","_reactRedux","_styledComponents","_ThemeProvider","_interopRequireDefault","_Settings","_serverUtil","_htmlpage","_jsxRuntime","renderSSRMinimal","_ref","store","theme","UUID","render","template","htmlpage","sheet","ServerStyleSheet","appHTML","renderToString","jsx","Provider","children","StyleSheetManager","instance","default","head","createHead","contextPath","getBasePath","html","state","dehydrate","_default","exports"],"sources":["../../src/react-server/renderSSRMinimal.js"],"sourcesContent":["// @flow\nimport { renderToString } from \"react-dom/server\";\n\nimport { Provider } from \"react-redux\";\n\nimport { ServerStyleSheet, StyleSheetManager } from \"styled-components\";\nimport ThemeProvider from \"../react-theme/ThemeProvider\";\n\nimport { getBasePath } from \"../constants/Settings\";\n\nimport { createHead, dehydrate } from \"./serverUtil\";\nimport htmlpage from \"./htmlpage\";\n\nimport type { Theme } from \"../react-theme/types\";\nimport type { ReduxStore } from \"../redux/types\";\nimport type { TemplateProps } from \"./htmlpage\";\ntype Props = {\n store: ReduxStore,\n theme?: Theme | Array<Theme>,\n UUID: string,\n render: Function,\n template?: (TemplateProps) => string,\n};\n\n/**\n */\nconst renderSSRMinimal = ({\n store,\n theme,\n UUID = \"\",\n render,\n template = htmlpage,\n}: Props): string => {\n const sheet = new ServerStyleSheet();\n\n const appHTML = renderToString(\n <Provider store={store}>\n <StyleSheetManager sheet={sheet.instance}>\n <ThemeProvider theme={theme}>{render()}</ThemeProvider>\n </StyleSheetManager>\n </Provider>,\n );\n\n const head = createHead(sheet, UUID);\n return template({\n contextPath: getBasePath(),\n html: appHTML,\n head,\n state: dehydrate(store),\n UUID,\n });\n};\n\nexport default renderSSRMinimal;\n"],"mappings":";;;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,iBAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAEA,IAAAK,SAAA,GAAAL,OAAA;AAEA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAH,sBAAA,CAAAJ,OAAA;AAAkC,IAAAQ,WAAA,GAAAR,OAAA;AAalC;AACA;AACA,MAAMS,gBAAgB,GAAGC,IAAA,IAMJ;EAAA,IANK;IACxBC,KAAK;IACLC,KAAK;IACLC,IAAI,GAAG,EAAE;IACTC,MAAM;IACNC,QAAQ,GAAGC;EACN,CAAC,GAAAN,IAAA;EACN,MAAMO,KAAK,GAAG,IAAIC,kCAAgB,CAAC,CAAC;EAEpC,MAAMC,OAAO,GAAG,IAAAC,sBAAc,eAC5B,IAAAZ,WAAA,CAAAa,GAAA,EAACpB,WAAA,CAAAqB,QAAQ;IAACX,KAAK,EAAEA,KAAM;IAAAY,QAAA,eACrB,IAAAf,WAAA,CAAAa,GAAA,EAACnB,iBAAA,CAAAsB,iBAAiB;MAACP,KAAK,EAAEA,KAAK,CAACQ,QAAS;MAAAF,QAAA,eACvC,IAAAf,WAAA,CAAAa,GAAA,EAAClB,cAAA,CAAAuB,OAAa;QAACd,KAAK,EAAEA,KAAM;QAAAW,QAAA,EAAET,MAAM,CAAC;MAAC,CAAgB;IAAC,CACtC;EAAC,CACZ,CACZ,CAAC;EAED,MAAMa,IAAI,GAAG,IAAAC,sBAAU,EAACX,KAAK,EAAEJ,IAAI,CAAC;EACpC,OAAOE,QAAQ,CAAC;IACdc,WAAW,EAAE,IAAAC,qBAAW,EAAC,CAAC;IAC1BC,IAAI,EAAEZ,OAAO;IACbQ,IAAI;IACJK,KAAK,EAAE,IAAAC,qBAAS,EAACtB,KAAK,CAAC;IACvBE;EACF,CAAC,CAAC;AACJ,CAAC;AAAC,IAAAqB,QAAA,GAAAC,OAAA,CAAAT,OAAA,GAEajB,gBAAgB","ignoreList":[]}
@@ -4,13 +4,14 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.modelByHref = exports.keyByHref = exports.getTab = exports.getPreference = exports.getModelsByType = exports.getForm = exports.getFirstModelByInstance = exports.getCaseView = exports.getApplication = exports.getAllModelsByInstance = exports.getActiveModels = exports.getActiveModelByInstance = exports.allKeysByHref = void 0;
7
+ exports.modelByHref = exports.keyByHref = exports.getTab = exports.getPreference = exports.getModelsByType = exports.getForm = exports.getFirstModelByInstance = exports.getCaseView = exports.getApplication = exports.getAllModelsByInstance = exports.getAllFinishedModels = exports.getActiveModels = exports.getActiveModelByInstance = exports.allKeysByHref = void 0;
8
8
  var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
9
9
  var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
10
10
  var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys"));
11
11
  var _find = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/find"));
12
12
  var _startsWith = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/starts-with"));
13
13
  var _stringify = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/json/stringify"));
14
+ var _values = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/values"));
14
15
  var _reselect = require("reselect");
15
16
  var _objects = require("../../utils/helpers/objects");
16
17
  var _Href = _interopRequireDefault(require("../../models/href/Href"));
@@ -255,5 +256,16 @@ const getModelsByType = (state, type) => {
255
256
  }
256
257
  return [];
257
258
  };
259
+
260
+ /**
261
+ */
258
262
  exports.getModelsByType = getModelsByType;
263
+ const getAllFinishedModels = state => {
264
+ if (state && state.modularui) {
265
+ var _context10, _context11;
266
+ return (0, _map.default)(_context10 = (0, _filter.default)(_context11 = (0, _values.default)(state.modularui)).call(_context11, entry => entry.status === "FINISHED")).call(_context10, entry => entry.model);
267
+ }
268
+ return [];
269
+ };
270
+ exports.getAllFinishedModels = getAllFinishedModels;
259
271
  //# sourceMappingURL=ModularUISelectors.js.map
@@ -295,3 +295,16 @@ export const getModelsByType = (
295
295
 
296
296
  return [];
297
297
  };
298
+
299
+ /**
300
+ */
301
+ export const getAllFinishedModels = (
302
+ state: ReduxState,
303
+ ): Array<ModularUIModel> => {
304
+ if (state && state.modularui) {
305
+ return Object.values(state.modularui)
306
+ .filter((entry) => entry.status === "FINISHED")
307
+ .map((entry) => entry.model);
308
+ }
309
+ return [];
310
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"ModularUISelectors.js","names":["_reselect","require","_objects","_Href","_interopRequireDefault","_ContentModel","_ContentTOCModel","_ApplicationModel","_TabModel","_CaseViewModel","_FormModel","getAllModelsByInstance","state","instance","locale","i18n","modularui","_context","_context2","_map","default","_filter","_keys","call","key","model","exports","getFirstModelByInstance","_context3","_find","getActiveModelByInstance","location","getLocation","_context4","_startsWith","selfhref","path","getApplication","ApplicationModel","getTab","TabModel","getCaseView","CaseViewModel","getForm","FormModel","modelByHref","href","_context5","findHref","Href","modelConfigKey","equals","keyByHref","_context6","allKeysByHref","_context7","router","pathname","getModels","models","forEach","modelKey","modelEntry","has","label","type","modelInfo","selfContentLink","ContentModel","ContentTOCModel","push","getActiveModels","createSelectorCreator","defaultMemoize","value","other","_stringify","contextModels","locationParts","split","reduce","accumulator","current","comparePath","decodeURIComponent","replace","foundEntry","encodedHref","toString","getPreference","preferenceName","preferences","getModelsByType","_context8","_context9"],"sources":["../../../src/redux/_modularui/ModularUISelectors.js"],"sourcesContent":["// @flow\nimport { createSelectorCreator, defaultMemoize } from \"reselect\";\nimport { has } from \"../../utils/helpers/objects\";\n\nimport Href from \"../../models/href/Href\";\nimport ContentModel from \"../../models/content/ContentModel\";\nimport ContentTOCModel from \"../../models/content/ContentTOCModel\";\nimport ApplicationModel from \"../../models/application/ApplicationModel\";\nimport TabModel from \"../../models/tab/TabModel\";\nimport CaseViewModel from \"../../models/caseview/CaseViewModel\";\nimport FormModel from \"../../models/form/FormModel\";\n\nimport type { ReduxState, PreferenceValue } from \"../types\";\nimport type { ModularUIModel } from \"../../models/types\";\n\n/**\n */\nexport const getAllModelsByInstance = <T>(\n state: ReduxState,\n instance: Class<T>,\n): Array<ModularUIModel> => {\n const locale = state?.i18n?.locale || \"en\";\n const modularui = state?.modularui;\n\n if (modularui) {\n return Object.keys(modularui)\n .filter((key) => {\n const { model } = modularui[key];\n return model instanceof instance && model.locale === locale;\n })\n .map((key) => modularui[key].model);\n }\n\n return [];\n};\n\n/**\n */\nexport const getFirstModelByInstance = <T>(\n state: ReduxState,\n instance: Class<T>,\n): T | null => {\n const locale = state?.i18n?.locale || \"en\";\n const modularui = state?.modularui;\n\n if (modularui) {\n const key = Object.keys(modularui).find((key) => {\n const { model } = modularui[key];\n return model instanceof instance && model.locale === locale;\n });\n\n if (key) {\n const { model } = modularui[key];\n if (model instanceof instance) {\n return model;\n }\n }\n }\n\n return null;\n};\n\n/**\n */\nexport const getActiveModelByInstance = <T>(\n state: ReduxState,\n instance: Class<T>,\n): T | null => {\n const location = getLocation(state);\n\n const locale = state?.i18n?.locale || \"en\";\n const modularui = state?.modularui;\n\n if (modularui) {\n const key = Object.keys(modularui).find((key) => {\n const { model } = modularui[key];\n return (\n model instanceof instance &&\n model.locale === locale &&\n location.startsWith(model.selfhref.path)\n );\n });\n\n if (key) {\n const { model } = modularui[key];\n if (model instanceof instance) {\n return model;\n }\n }\n }\n\n return null;\n};\n\n/**\n * Get the application model, which is the model with selfhref '/'\n */\nexport const getApplication = (state: ReduxState): null | ApplicationModel =>\n getFirstModelByInstance(state, ApplicationModel);\n\n/**\n */\nexport const getTab = (state: ReduxState): null | TabModel =>\n getFirstModelByInstance(state, TabModel);\n\n/**\n */\nexport const getCaseView = (state: ReduxState): null | CaseViewModel =>\n getFirstModelByInstance(state, CaseViewModel);\n\n/**\n */\nexport const getForm = (state: ReduxState): null | FormModel =>\n getFirstModelByInstance(state, FormModel);\n\n/**\n * Get the model by it's href\n */\nexport const modelByHref = (\n state: ReduxState,\n href: Href | string,\n): null | ModularUIModel => {\n if (state && state.modularui) {\n const findHref = href instanceof Href ? href : new Href(href);\n\n const modelConfigKey = Object.keys(state.modularui).find((key) => {\n const model = state.modularui[key];\n\n return (\n model.model &&\n model.model.selfhref &&\n model.model.selfhref.equals(findHref)\n );\n });\n\n if (modelConfigKey) {\n return state.modularui[modelConfigKey].model;\n }\n }\n\n return null;\n};\n\n/**\n * Return the key of a model by the selfhref the model is saved in the reducer\n */\nexport const keyByHref = (state: ReduxState, href: Href | string): ?string => {\n if (state && state.modularui) {\n const findHref = href instanceof Href ? href : new Href(href);\n\n return Object.keys(state.modularui).find((key) => {\n const { model } = state.modularui[key];\n return model && model.selfhref && model.selfhref.equals(findHref);\n });\n }\n\n return null;\n};\n\n/**\n * Returns all model keys found in the store, restrict on href\n */\nexport const allKeysByHref = (\n state: ReduxState,\n href: Href | string,\n): Array<string> => {\n if (state && state.modularui) {\n const findHref = href instanceof Href ? href : new Href(href);\n\n return Object.keys(state.modularui).filter((key) => {\n const { model } = state.modularui[key];\n return model && model.selfhref && model.selfhref.equals(findHref);\n });\n }\n\n return [];\n};\n\n/**\n */\nconst getLocation = (state: ReduxState): string =>\n state?.router?.location.pathname;\n\n/**\n */\nconst getModels = (state: ReduxState) => {\n const models = [];\n\n Object.keys(state.modularui).forEach((modelKey: string) => {\n const modelEntry = state.modularui[modelKey];\n\n if (has(modelEntry, \"model\")) {\n const { key, selfhref, label, type } = modelEntry.model;\n\n const modelInfo = {\n key,\n selfhref,\n label,\n type,\n selfContentLink: null,\n };\n\n if (\n modelEntry.model instanceof ContentModel ||\n modelEntry.model instanceof ContentTOCModel\n ) {\n models.push({\n ...modelInfo,\n selfContentLink: modelEntry.model.selfContentLink,\n });\n } else {\n models.push(modelInfo);\n }\n }\n });\n\n return models;\n};\n\nexport const getActiveModels: (state: ReduxState) => Array<{\n key: string,\n href: Href,\n label: string,\n type: string,\n}> = createSelectorCreator(\n defaultMemoize,\n (value, other) => JSON.stringify(value) === JSON.stringify(other),\n)([getLocation, getModels], (location, models) => {\n const contextModels = [];\n\n if (location) {\n const locationParts = location.split(\"/\");\n\n locationParts.reduce((accumulator, current) => {\n const path = `${accumulator}/${current}`;\n\n // Remove modelcatalog part to match breadcrumb parts\n const comparePath = decodeURIComponent(path).replace(\n \"/modelcatalog/\",\n \"/\",\n );\n\n const foundEntry = models.find(\n (model) => model.selfhref && model.selfhref.equals(comparePath),\n );\n\n if (foundEntry) {\n const { key, label, type, selfhref, selfContentLink } = foundEntry;\n\n const href =\n path.startsWith(\"/modelcatalog/\") && selfContentLink\n ? new Href(`/modelcatalog${selfContentLink.encodedHref.toString()}`)\n : selfhref;\n\n contextModels.push({ key, href, label, type });\n }\n\n return path;\n });\n }\n\n return contextModels;\n});\n\n/**\n */\nexport const getPreference = (\n state: ReduxState,\n preferenceName: string,\n): null | PreferenceValue => {\n if (state && state.preferences) {\n return state.preferences[preferenceName];\n }\n\n return null;\n};\n\n/**\n * @deprecated - Use getFirstModelByInstance or the appropriate getter for the model type: getApplication, getTab, etc\n */\nexport const getModelsByType = (\n state: ReduxState,\n type: string,\n): Array<ModularUIModel> => {\n if (state && state.modularui) {\n return Object.keys(state.modularui)\n .filter(\n (key) =>\n state.modularui[key] &&\n state.modularui[key].model &&\n state.modularui[key].model.type === type,\n )\n .map((key) => state.modularui[key].model);\n }\n\n return [];\n};\n"],"mappings":";;;;;;;;;;;;;AACA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,KAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,aAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,gBAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,iBAAA,GAAAH,sBAAA,CAAAH,OAAA;AACA,IAAAO,SAAA,GAAAJ,sBAAA,CAAAH,OAAA;AACA,IAAAQ,cAAA,GAAAL,sBAAA,CAAAH,OAAA;AACA,IAAAS,UAAA,GAAAN,sBAAA,CAAAH,OAAA;AAKA;AACA;AACO,MAAMU,sBAAsB,GAAGA,CACpCC,KAAiB,EACjBC,QAAkB,KACQ;EAC1B,MAAMC,MAAM,GAAGF,KAAK,EAAEG,IAAI,EAAED,MAAM,IAAI,IAAI;EAC1C,MAAME,SAAS,GAAGJ,KAAK,EAAEI,SAAS;EAElC,IAAIA,SAAS,EAAE;IAAA,IAAAC,QAAA,EAAAC,SAAA;IACb,OAAO,IAAAC,IAAA,CAAAC,OAAA,EAAAH,QAAA,OAAAI,OAAA,CAAAD,OAAA,EAAAF,SAAA,OAAAI,KAAA,CAAAF,OAAA,EAAYJ,SAAS,CAAC,EAAAO,IAAA,CAAAL,SAAA,EAClBM,GAAG,IAAK;MACf,MAAM;QAAEC;MAAM,CAAC,GAAGT,SAAS,CAACQ,GAAG,CAAC;MAChC,OAAOC,KAAK,YAAYZ,QAAQ,IAAIY,KAAK,CAACX,MAAM,KAAKA,MAAM;IAC7D,CAAC,CAAC,EAAAS,IAAA,CAAAN,QAAA,EACIO,GAAG,IAAKR,SAAS,CAACQ,GAAG,CAAC,CAACC,KAAK,CAAC;EACvC;EAEA,OAAO,EAAE;AACX,CAA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SAAA,OAAAxE,OAAA,CAAAD,OAAA,EAAA0E,SAAA,OAAAxE,KAAA,CAAAF,OAAA,EAAYR,KAAK,CAACI,SAAS,CAAC,EAAAO,IAAA,CAAAuE,SAAA,EAE9BtE,GAAG,IACFZ,KAAK,CAACI,SAAS,CAACQ,GAAG,CAAC,IACpBZ,KAAK,CAACI,SAAS,CAACQ,GAAG,CAAC,CAACC,KAAK,IAC1Bb,KAAK,CAACI,SAAS,CAACQ,GAAG,CAAC,CAACC,KAAK,CAACwC,IAAI,KAAKA,IACxC,CAAC,EAAA1C,IAAA,CAAAsE,SAAA,EACKrE,GAAG,IAAKZ,KAAK,CAACI,SAAS,CAACQ,GAAG,CAAC,CAACC,KAAK,CAAC;EAC7C;EAEA,OAAO,EAAE;AACX,CAAC;AAACC,OAAA,CAAAkE,eAAA,GAAAA,eAAA","ignoreList":[]}
1
+ {"version":3,"file":"ModularUISelectors.js","names":["_reselect","require","_objects","_Href","_interopRequireDefault","_ContentModel","_ContentTOCModel","_ApplicationModel","_TabModel","_CaseViewModel","_FormModel","getAllModelsByInstance","state","instance","locale","i18n","modularui","_context","_context2","_map","default","_filter","_keys","call","key","model","exports","getFirstModelByInstance","_context3","_find","getActiveModelByInstance","location","getLocation","_context4","_startsWith","selfhref","path","getApplication","ApplicationModel","getTab","TabModel","getCaseView","CaseViewModel","getForm","FormModel","modelByHref","href","_context5","findHref","Href","modelConfigKey","equals","keyByHref","_context6","allKeysByHref","_context7","router","pathname","getModels","models","forEach","modelKey","modelEntry","has","label","type","modelInfo","selfContentLink","ContentModel","ContentTOCModel","push","getActiveModels","createSelectorCreator","defaultMemoize","value","other","_stringify","contextModels","locationParts","split","reduce","accumulator","current","comparePath","decodeURIComponent","replace","foundEntry","encodedHref","toString","getPreference","preferenceName","preferences","getModelsByType","_context8","_context9","getAllFinishedModels","_context10","_context11","_values","entry","status"],"sources":["../../../src/redux/_modularui/ModularUISelectors.js"],"sourcesContent":["// @flow\nimport { createSelectorCreator, defaultMemoize } from \"reselect\";\nimport { has } from \"../../utils/helpers/objects\";\n\nimport Href from \"../../models/href/Href\";\nimport ContentModel from \"../../models/content/ContentModel\";\nimport ContentTOCModel from \"../../models/content/ContentTOCModel\";\nimport ApplicationModel from \"../../models/application/ApplicationModel\";\nimport TabModel from \"../../models/tab/TabModel\";\nimport CaseViewModel from \"../../models/caseview/CaseViewModel\";\nimport FormModel from \"../../models/form/FormModel\";\n\nimport type { ReduxState, PreferenceValue } from \"../types\";\nimport type { ModularUIModel } from \"../../models/types\";\n\n/**\n */\nexport const getAllModelsByInstance = <T>(\n state: ReduxState,\n instance: Class<T>,\n): Array<ModularUIModel> => {\n const locale = state?.i18n?.locale || \"en\";\n const modularui = state?.modularui;\n\n if (modularui) {\n return Object.keys(modularui)\n .filter((key) => {\n const { model } = modularui[key];\n return model instanceof instance && model.locale === locale;\n })\n .map((key) => modularui[key].model);\n }\n\n return [];\n};\n\n/**\n */\nexport const getFirstModelByInstance = <T>(\n state: ReduxState,\n instance: Class<T>,\n): T | null => {\n const locale = state?.i18n?.locale || \"en\";\n const modularui = state?.modularui;\n\n if (modularui) {\n const key = Object.keys(modularui).find((key) => {\n const { model } = modularui[key];\n return model instanceof instance && model.locale === locale;\n });\n\n if (key) {\n const { model } = modularui[key];\n if (model instanceof instance) {\n return model;\n }\n }\n }\n\n return null;\n};\n\n/**\n */\nexport const getActiveModelByInstance = <T>(\n state: ReduxState,\n instance: Class<T>,\n): T | null => {\n const location = getLocation(state);\n\n const locale = state?.i18n?.locale || \"en\";\n const modularui = state?.modularui;\n\n if (modularui) {\n const key = Object.keys(modularui).find((key) => {\n const { model } = modularui[key];\n return (\n model instanceof instance &&\n model.locale === locale &&\n location.startsWith(model.selfhref.path)\n );\n });\n\n if (key) {\n const { model } = modularui[key];\n if (model instanceof instance) {\n return model;\n }\n }\n }\n\n return null;\n};\n\n/**\n * Get the application model, which is the model with selfhref '/'\n */\nexport const getApplication = (state: ReduxState): null | ApplicationModel =>\n getFirstModelByInstance(state, ApplicationModel);\n\n/**\n */\nexport const getTab = (state: ReduxState): null | TabModel =>\n getFirstModelByInstance(state, TabModel);\n\n/**\n */\nexport const getCaseView = (state: ReduxState): null | CaseViewModel =>\n getFirstModelByInstance(state, CaseViewModel);\n\n/**\n */\nexport const getForm = (state: ReduxState): null | FormModel =>\n getFirstModelByInstance(state, FormModel);\n\n/**\n * Get the model by it's href\n */\nexport const modelByHref = (\n state: ReduxState,\n href: Href | string,\n): null | ModularUIModel => {\n if (state && state.modularui) {\n const findHref = href instanceof Href ? href : new Href(href);\n\n const modelConfigKey = Object.keys(state.modularui).find((key) => {\n const model = state.modularui[key];\n\n return (\n model.model &&\n model.model.selfhref &&\n model.model.selfhref.equals(findHref)\n );\n });\n\n if (modelConfigKey) {\n return state.modularui[modelConfigKey].model;\n }\n }\n\n return null;\n};\n\n/**\n * Return the key of a model by the selfhref the model is saved in the reducer\n */\nexport const keyByHref = (state: ReduxState, href: Href | string): ?string => {\n if (state && state.modularui) {\n const findHref = href instanceof Href ? href : new Href(href);\n\n return Object.keys(state.modularui).find((key) => {\n const { model } = state.modularui[key];\n return model && model.selfhref && model.selfhref.equals(findHref);\n });\n }\n\n return null;\n};\n\n/**\n * Returns all model keys found in the store, restrict on href\n */\nexport const allKeysByHref = (\n state: ReduxState,\n href: Href | string,\n): Array<string> => {\n if (state && state.modularui) {\n const findHref = href instanceof Href ? href : new Href(href);\n\n return Object.keys(state.modularui).filter((key) => {\n const { model } = state.modularui[key];\n return model && model.selfhref && model.selfhref.equals(findHref);\n });\n }\n\n return [];\n};\n\n/**\n */\nconst getLocation = (state: ReduxState): string =>\n state?.router?.location.pathname;\n\n/**\n */\nconst getModels = (state: ReduxState) => {\n const models = [];\n\n Object.keys(state.modularui).forEach((modelKey: string) => {\n const modelEntry = state.modularui[modelKey];\n\n if (has(modelEntry, \"model\")) {\n const { key, selfhref, label, type } = modelEntry.model;\n\n const modelInfo = {\n key,\n selfhref,\n label,\n type,\n selfContentLink: null,\n };\n\n if (\n modelEntry.model instanceof ContentModel ||\n modelEntry.model instanceof ContentTOCModel\n ) {\n models.push({\n ...modelInfo,\n selfContentLink: modelEntry.model.selfContentLink,\n });\n } else {\n models.push(modelInfo);\n }\n }\n });\n\n return models;\n};\n\nexport const getActiveModels: (state: ReduxState) => Array<{\n key: string,\n href: Href,\n label: string,\n type: string,\n}> = createSelectorCreator(\n defaultMemoize,\n (value, other) => JSON.stringify(value) === JSON.stringify(other),\n)([getLocation, getModels], (location, models) => {\n const contextModels = [];\n\n if (location) {\n const locationParts = location.split(\"/\");\n\n locationParts.reduce((accumulator, current) => {\n const path = `${accumulator}/${current}`;\n\n // Remove modelcatalog part to match breadcrumb parts\n const comparePath = decodeURIComponent(path).replace(\n \"/modelcatalog/\",\n \"/\",\n );\n\n const foundEntry = models.find(\n (model) => model.selfhref && model.selfhref.equals(comparePath),\n );\n\n if (foundEntry) {\n const { key, label, type, selfhref, selfContentLink } = foundEntry;\n\n const href =\n path.startsWith(\"/modelcatalog/\") && selfContentLink\n ? new Href(`/modelcatalog${selfContentLink.encodedHref.toString()}`)\n : selfhref;\n\n contextModels.push({ key, href, label, type });\n }\n\n return path;\n });\n }\n\n return contextModels;\n});\n\n/**\n */\nexport const getPreference = (\n state: ReduxState,\n preferenceName: string,\n): null | PreferenceValue => {\n if (state && state.preferences) {\n return state.preferences[preferenceName];\n }\n\n return null;\n};\n\n/**\n * @deprecated - Use getFirstModelByInstance or the appropriate getter for the model type: getApplication, getTab, etc\n */\nexport const getModelsByType = (\n state: ReduxState,\n type: string,\n): Array<ModularUIModel> => {\n if (state && state.modularui) {\n return Object.keys(state.modularui)\n .filter(\n (key) =>\n state.modularui[key] &&\n state.modularui[key].model &&\n state.modularui[key].model.type === type,\n )\n .map((key) => state.modularui[key].model);\n }\n\n return [];\n};\n\n/**\n */\nexport const getAllFinishedModels = (\n state: ReduxState,\n): Array<ModularUIModel> => {\n if (state && state.modularui) {\n return Object.values(state.modularui)\n .filter((entry) => entry.status === \"FIN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AAA,EAAYR,KAAK,CAACI,SAAS,CAAC,EAAAO,IAAA,CAAAuE,SAAA,EAE9BtE,GAAG,IACFZ,KAAK,CAACI,SAAS,CAACQ,GAAG,CAAC,IACpBZ,KAAK,CAACI,SAAS,CAACQ,GAAG,CAAC,CAACC,KAAK,IAC1Bb,KAAK,CAACI,SAAS,CAACQ,GAAG,CAAC,CAACC,KAAK,CAACwC,IAAI,KAAKA,IACxC,CAAC,EAAA1C,IAAA,CAAAsE,SAAA,EACKrE,GAAG,IAAKZ,KAAK,CAACI,SAAS,CAACQ,GAAG,CAAC,CAACC,KAAK,CAAC;EAC7C;EAEA,OAAO,EAAE;AACX,CAAC;;AAED;AACA;AADAC,OAAA,CAAAkE,eAAA,GAAAA,eAAA;AAEO,MAAMG,oBAAoB,GAC/BnF,KAAiB,IACS;EAC1B,IAAIA,KAAK,IAAIA,KAAK,CAACI,SAAS,EAAE;IAAA,IAAAgF,UAAA,EAAAC,UAAA;IAC5B,OAAO,IAAA9E,IAAA,CAAAC,OAAA,EAAA4E,UAAA,OAAA3E,OAAA,CAAAD,OAAA,EAAA6E,UAAA,OAAAC,OAAA,CAAA9E,OAAA,EAAcR,KAAK,CAACI,SAAS,CAAC,EAAAO,IAAA,CAAA0E,UAAA,EAC1BE,KAAK,IAAKA,KAAK,CAACC,MAAM,KAAK,UAAU,CAAC,EAAA7E,IAAA,CAAAyE,UAAA,EACzCG,KAAK,IAAKA,KAAK,CAAC1E,KAAK,CAAC;EAChC;EACA,OAAO,EAAE;AACX,CAAC;AAACC,OAAA,CAAAqE,oBAAA,GAAAA,oBAAA","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beinformed/ui",
3
- "version": "1.55.1",
3
+ "version": "1.56.0",
4
4
  "description": "Toolbox for be informed javascript layouts",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "bugs": "http://support.beinformed.com",
@@ -82,7 +82,7 @@
82
82
  "styled-components": "^5.0.0"
83
83
  },
84
84
  "dependencies": {
85
- "@babel/runtime-corejs3": "^7.25.6",
85
+ "@babel/runtime-corejs3": "^7.25.7",
86
86
  "big.js": "^6.2.2",
87
87
  "date-fns": "^4.1.0",
88
88
  "deepmerge": "^4.3.1",
@@ -98,16 +98,16 @@
98
98
  "setimmediate": "^1.0.5"
99
99
  },
100
100
  "devDependencies": {
101
- "@babel/cli": "^7.25.6",
102
- "@babel/core": "^7.25.2",
103
- "@babel/eslint-parser": "^7.25.1",
104
- "@babel/eslint-plugin": "^7.25.1",
101
+ "@babel/cli": "^7.25.7",
102
+ "@babel/core": "^7.25.7",
103
+ "@babel/eslint-parser": "^7.25.7",
104
+ "@babel/eslint-plugin": "^7.25.7",
105
105
  "@babel/plugin-proposal-class-properties": "^7.18.6",
106
106
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
107
- "@babel/plugin-transform-runtime": "^7.25.4",
108
- "@babel/preset-env": "^7.25.4",
109
- "@babel/preset-flow": "^7.24.7",
110
- "@babel/preset-react": "^7.24.7",
107
+ "@babel/plugin-transform-runtime": "^7.25.7",
108
+ "@babel/preset-env": "^7.25.7",
109
+ "@babel/preset-flow": "^7.25.7",
110
+ "@babel/preset-react": "^7.25.7",
111
111
  "@commitlint/cli": "^19.5.0",
112
112
  "@commitlint/config-conventional": "^19.5.0",
113
113
  "@testing-library/react": "^16.0.1",
@@ -122,16 +122,16 @@
122
122
  "eslint-config-prettier": "^9.1.0",
123
123
  "eslint-plugin-babel": "^5.3.1",
124
124
  "eslint-plugin-ft-flow": "^3.0.11",
125
- "eslint-plugin-import": "^2.30.0",
125
+ "eslint-plugin-import": "^2.31.0",
126
126
  "eslint-plugin-jest": "^28.8.3",
127
- "eslint-plugin-jsdoc": "^50.2.3",
128
- "eslint-plugin-react": "^7.36.1",
127
+ "eslint-plugin-jsdoc": "^50.3.1",
128
+ "eslint-plugin-react": "^7.37.1",
129
129
  "eslint-plugin-react-hooks": "^4.6.2",
130
130
  "eslint-plugin-you-dont-need-lodash-underscore": "^6.14.0",
131
131
  "flow-bin": "^0.200.1",
132
132
  "flow-copy-source": "^2.0.9",
133
133
  "flow-typed": "^3.9.0",
134
- "hermes-eslint": "^0.23.1",
134
+ "hermes-eslint": "^0.24.0",
135
135
  "history": "^4.0.0",
136
136
  "husky": "^9.1.6",
137
137
  "jest": "^29.7.0",
@@ -7,7 +7,7 @@ import type { ModelCategory } from "./ModelCategoryModel";
7
7
  /**
8
8
  * Model category collection
9
9
  */
10
- export default class SourceReferenceCollection extends BaseCollection<ModelCategoryModel> {
10
+ export default class ModelCategoryCollection extends BaseCollection<ModelCategoryModel> {
11
11
  /**
12
12
  */
13
13
  constructor(modelCategories: Array<ModelCategory> = []) {
@@ -295,3 +295,16 @@ export const getModelsByType = (
295
295
 
296
296
  return [];
297
297
  };
298
+
299
+ /**
300
+ */
301
+ export const getAllFinishedModels = (
302
+ state: ReduxState,
303
+ ): Array<ModularUIModel> => {
304
+ if (state && state.modularui) {
305
+ return Object.values(state.modularui)
306
+ .filter((entry) => entry.status === "FINISHED")
307
+ .map((entry) => entry.model);
308
+ }
309
+ return [];
310
+ };