@vived/core 1.4.4 → 1.4.5

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.
@@ -44,7 +44,7 @@ exports.examplePmAdapter = {
44
44
  // Find the PM using the provided ID
45
45
  const pm = ExamplePM_1.ExamplePM.getById(id, appObjects);
46
46
  if (!pm) {
47
- appObjects.submitError("examplePmAdapter", "Unable to find ExamplePM");
47
+ appObjects.submitWarning("examplePmAdapter", "Unable to find ExamplePM");
48
48
  return;
49
49
  }
50
50
  // Register the UI component's callback to receive updates
@@ -1 +1 @@
1
- {"version":3,"file":"examplePmAdapter.js","sourceRoot":"","sources":["../../../../src/ExampleFeature/Adapters/examplePmAdapter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;AAIH,gDAA6C;AAE7C;;;GAGG;AACU,QAAA,gBAAgB,GAAsB;IACjD,qDAAqD;IACrD,SAAS,EAAE,EAAE;IAEb;;;;;OAKG;IACH,SAAS,EAAE,CACT,EAAU,EACV,UAAyB,EACzB,KAA2B,EAC3B,EAAE;QACF,oCAAoC;QACpC,IAAI,CAAC,EAAE;YAAE,OAAO;QAEhB,oCAAoC;QACpC,MAAM,EAAE,GAAG,qBAAS,CAAC,OAAO,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;QAC7C,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,UAAU,CAAC,WAAW,CAAC,kBAAkB,EAAE,0BAA0B,CAAC,CAAC;YACvE,OAAO;QACT,CAAC;QAED,0DAA0D;QAC1D,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC;IAED;;;;;OAKG;IACH,WAAW,EAAE,CACX,EAAU,EACV,UAAyB,EACzB,KAA2B,EAC3B,EAAE;QACF,+CAA+C;QAC/C,qBAAS,CAAC,OAAO,CAAC,EAAE,EAAE,UAAU,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;IACvD,CAAC;CACF,CAAC","sourcesContent":["/**\r\n * examplePmAdapter.ts\r\n * \r\n * This file demonstrates how to implement a PM Adapter to connect UI components to PMs.\r\n * PM Adapters provide a standardized way for UI frameworks to subscribe to PM updates.\r\n * This adapter connects to regular (non-singleton) PMs that require an AppObject ID.\r\n * \r\n * Key concepts:\r\n * - PM Adapters implement the PmAdapter<VM> interface where VM is the view model type\r\n * - They handle subscribing UI components to PMs and unsubscribing when done\r\n * - They provide a default view model for initial rendering before data is available\r\n * - They abstract away the details of finding and connecting to specific PMs\r\n * \r\n * Usage pattern (React example):\r\n * ```typescript\r\n * // In a React component\r\n * function MyComponent({ id }) {\r\n * const viewModel = usePmAdapter(examplePmAdapter, id);\r\n * return <div>{viewModel}</div>;\r\n * }\r\n * ```\r\n */\r\n\r\nimport { AppObjectRepo } from \"../../AppObject\";\r\nimport { PmAdapter } from \"../../Types/PmAdapter\";\r\nimport { ExamplePM } from \"../PMs/ExamplePM\";\r\n\r\n/**\r\n * An adapter that connects UI components to ExamplePM instances.\r\n * Implements PmAdapter<string> because ExamplePM provides string view models.\r\n */\r\nexport const examplePmAdapter: PmAdapter<string> = {\r\n // Default view model to use before data is available\r\n defaultVM: \"\",\r\n \r\n /**\r\n * Subscribes a UI component to updates from an ExamplePM\r\n * @param id The ID of the AppObject containing the PM\r\n * @param appObjects The application's AppObjectRepo\r\n * @param setVM Callback function that updates the UI component\r\n */\r\n subscribe: (\r\n id: string,\r\n appObjects: AppObjectRepo,\r\n setVM: (vm: string) => void\r\n ) => {\r\n // Return early if no ID is provided\r\n if (!id) return;\r\n\r\n // Find the PM using the provided ID\r\n const pm = ExamplePM.getById(id, appObjects);\r\n if (!pm) {\r\n appObjects.submitError(\"examplePmAdapter\", \"Unable to find ExamplePM\");\r\n return;\r\n }\r\n \r\n // Register the UI component's callback to receive updates\r\n pm.addView(setVM);\r\n },\r\n \r\n /**\r\n * Unsubscribes a UI component from updates when it's no longer needed\r\n * @param id The ID of the AppObject containing the PM\r\n * @param appObjects The application's AppObjectRepo\r\n * @param setVM The same callback function that was used to subscribe\r\n */\r\n unsubscribe: (\r\n id: string,\r\n appObjects: AppObjectRepo,\r\n setVM: (vm: string) => void\r\n ) => {\r\n // Find the PM and remove the view if it exists\r\n ExamplePM.getById(id, appObjects)?.removeView(setVM);\r\n }\r\n};\r\n"]}
1
+ {"version":3,"file":"examplePmAdapter.js","sourceRoot":"","sources":["../../../../src/ExampleFeature/Adapters/examplePmAdapter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;AAIH,gDAA6C;AAE7C;;;GAGG;AACU,QAAA,gBAAgB,GAAsB;IACjD,qDAAqD;IACrD,SAAS,EAAE,EAAE;IAEb;;;;;OAKG;IACH,SAAS,EAAE,CACT,EAAU,EACV,UAAyB,EACzB,KAA2B,EAC3B,EAAE;QACF,oCAAoC;QACpC,IAAI,CAAC,EAAE;YAAE,OAAO;QAEhB,oCAAoC;QACpC,MAAM,EAAE,GAAG,qBAAS,CAAC,OAAO,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;QAC7C,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,UAAU,CAAC,aAAa,CAAC,kBAAkB,EAAE,0BAA0B,CAAC,CAAC;YACzE,OAAO;QACT,CAAC;QAED,0DAA0D;QAC1D,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC;IAED;;;;;OAKG;IACH,WAAW,EAAE,CACX,EAAU,EACV,UAAyB,EACzB,KAA2B,EAC3B,EAAE;QACF,+CAA+C;QAC/C,qBAAS,CAAC,OAAO,CAAC,EAAE,EAAE,UAAU,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;IACvD,CAAC;CACF,CAAC","sourcesContent":["/**\r\n * examplePmAdapter.ts\r\n * \r\n * This file demonstrates how to implement a PM Adapter to connect UI components to PMs.\r\n * PM Adapters provide a standardized way for UI frameworks to subscribe to PM updates.\r\n * This adapter connects to regular (non-singleton) PMs that require an AppObject ID.\r\n * \r\n * Key concepts:\r\n * - PM Adapters implement the PmAdapter<VM> interface where VM is the view model type\r\n * - They handle subscribing UI components to PMs and unsubscribing when done\r\n * - They provide a default view model for initial rendering before data is available\r\n * - They abstract away the details of finding and connecting to specific PMs\r\n * \r\n * Usage pattern (React example):\r\n * ```typescript\r\n * // In a React component\r\n * function MyComponent({ id }) {\r\n * const viewModel = usePmAdapter(examplePmAdapter, id);\r\n * return <div>{viewModel}</div>;\r\n * }\r\n * ```\r\n */\r\n\r\nimport { AppObjectRepo } from \"../../AppObject\";\r\nimport { PmAdapter } from \"../../Types/PmAdapter\";\r\nimport { ExamplePM } from \"../PMs/ExamplePM\";\r\n\r\n/**\r\n * An adapter that connects UI components to ExamplePM instances.\r\n * Implements PmAdapter<string> because ExamplePM provides string view models.\r\n */\r\nexport const examplePmAdapter: PmAdapter<string> = {\r\n // Default view model to use before data is available\r\n defaultVM: \"\",\r\n \r\n /**\r\n * Subscribes a UI component to updates from an ExamplePM\r\n * @param id The ID of the AppObject containing the PM\r\n * @param appObjects The application's AppObjectRepo\r\n * @param setVM Callback function that updates the UI component\r\n */\r\n subscribe: (\r\n id: string,\r\n appObjects: AppObjectRepo,\r\n setVM: (vm: string) => void\r\n ) => {\r\n // Return early if no ID is provided\r\n if (!id) return;\r\n\r\n // Find the PM using the provided ID\r\n const pm = ExamplePM.getById(id, appObjects);\r\n if (!pm) {\r\n appObjects.submitWarning(\"examplePmAdapter\", \"Unable to find ExamplePM\");\r\n return;\r\n }\r\n \r\n // Register the UI component's callback to receive updates\r\n pm.addView(setVM);\r\n },\r\n \r\n /**\r\n * Unsubscribes a UI component from updates when it's no longer needed\r\n * @param id The ID of the AppObject containing the PM\r\n * @param appObjects The application's AppObjectRepo\r\n * @param setVM The same callback function that was used to subscribe\r\n */\r\n unsubscribe: (\r\n id: string,\r\n appObjects: AppObjectRepo,\r\n setVM: (vm: string) => void\r\n ) => {\r\n // Find the PM and remove the view if it exists\r\n ExamplePM.getById(id, appObjects)?.removeView(setVM);\r\n }\r\n};\r\n"]}
@@ -41,7 +41,7 @@ exports.exampleSingletonPmAdapter = {
41
41
  // Find the singleton PM using its static get method
42
42
  const pm = ExampleSingletonPM_1.ExampleSingletonPM.get(appObjects);
43
43
  if (!pm) {
44
- appObjects.submitError("exampleSingletonPmAdapter", "Unable to find ExampleSingletonPM");
44
+ appObjects.submitWarning("exampleSingletonPmAdapter", "Unable to find ExampleSingletonPM");
45
45
  return;
46
46
  }
47
47
  // Register the UI component's callback to receive updates
@@ -1 +1 @@
1
- {"version":3,"file":"exampleSingletonPmAdapter.js","sourceRoot":"","sources":["../../../../src/ExampleFeature/Adapters/exampleSingletonPmAdapter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;AAIH,kEAImC;AAEnC;;;GAGG;AACU,QAAA,yBAAyB,GAAkC;IACtE,qDAAqD;IACrD,SAAS,EAAE,6CAAwB;IAEnC;;;;OAIG;IACH,SAAS,EAAE,CAAC,UAAyB,EAAE,KAA8B,EAAE,EAAE;QACvE,oDAAoD;QACpD,MAAM,EAAE,GAAG,uCAAkB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAC9C,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,UAAU,CAAC,WAAW,CACpB,2BAA2B,EAC3B,mCAAmC,CACpC,CAAC;YACF,OAAO;QACT,CAAC;QAED,0DAA0D;QAC1D,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC;IAED;;;;OAIG;IACH,WAAW,EAAE,CAAC,UAAyB,EAAE,KAA8B,EAAE,EAAE;QACzE,yDAAyD;QACzD,uCAAkB,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;IACxD,CAAC;CACF,CAAC","sourcesContent":["/**\r\n * exampleSingletonPmAdapter.ts\r\n * \r\n * This file demonstrates how to implement a Singleton PM Adapter to connect UI components\r\n * to singleton PMs. Singleton PM Adapters provide a standardized way for UI frameworks\r\n * to subscribe to singleton PM updates without needing to specify an AppObject ID.\r\n * \r\n * Key concepts:\r\n * - Singleton PM Adapters implement the SingletonPmAdapter<VM> interface\r\n * - They handle subscribing UI components to singleton PMs and unsubscribing when done\r\n * - They provide a default view model for initial rendering before data is available\r\n * - They don't require an AppObject ID since they connect to globally accessible singletons\r\n * \r\n * Usage pattern (React example):\r\n * ```typescript\r\n * // In a React component\r\n * function MyComponent() {\r\n * // Note: no ID needed since it's connecting to a singleton\r\n * const viewModel = useSingletonPmAdapter(exampleSingletonPmAdapter);\r\n * return <div>{viewModel.aBoolProperty ? \"True\" : \"False\"}</div>;\r\n * }\r\n * ```\r\n */\r\n\r\nimport { AppObjectRepo } from \"../../AppObject\";\r\nimport { SingletonPmAdapter } from \"../../Types/SingletonPmAdapter\";\r\nimport {\r\n defaultSlideNavigationVM,\r\n ExampleSingletonPM,\r\n ExampleVM\r\n} from \"../PMs/ExampleSingletonPM\";\r\n\r\n/**\r\n * An adapter that connects UI components to the ExampleSingletonPM.\r\n * Implements SingletonPmAdapter<ExampleVM> because ExampleSingletonPM provides ExampleVM view models.\r\n */\r\nexport const exampleSingletonPmAdapter: SingletonPmAdapter<ExampleVM> = {\r\n // Default view model to use before data is available\r\n defaultVM: defaultSlideNavigationVM,\r\n \r\n /**\r\n * Subscribes a UI component to updates from the ExampleSingletonPM\r\n * @param appObjects The application's AppObjectRepo\r\n * @param setVM Callback function that updates the UI component\r\n */\r\n subscribe: (appObjects: AppObjectRepo, setVM: (vm: ExampleVM) => void) => {\r\n // Find the singleton PM using its static get method\r\n const pm = ExampleSingletonPM.get(appObjects);\r\n if (!pm) {\r\n appObjects.submitError(\r\n \"exampleSingletonPmAdapter\",\r\n \"Unable to find ExampleSingletonPM\"\r\n );\r\n return;\r\n }\r\n \r\n // Register the UI component's callback to receive updates\r\n pm.addView(setVM);\r\n },\r\n \r\n /**\r\n * Unsubscribes a UI component from updates when it's no longer needed\r\n * @param appObjects The application's AppObjectRepo\r\n * @param setVM The same callback function that was used to subscribe\r\n */\r\n unsubscribe: (appObjects: AppObjectRepo, setVM: (vm: ExampleVM) => void) => {\r\n // Find the singleton PM and remove the view if it exists\r\n ExampleSingletonPM.get(appObjects)?.removeView(setVM);\r\n }\r\n};\r\n"]}
1
+ {"version":3,"file":"exampleSingletonPmAdapter.js","sourceRoot":"","sources":["../../../../src/ExampleFeature/Adapters/exampleSingletonPmAdapter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;AAIH,kEAImC;AAEnC;;;GAGG;AACU,QAAA,yBAAyB,GAAkC;IACtE,qDAAqD;IACrD,SAAS,EAAE,6CAAwB;IAEnC;;;;OAIG;IACH,SAAS,EAAE,CAAC,UAAyB,EAAE,KAA8B,EAAE,EAAE;QACvE,oDAAoD;QACpD,MAAM,EAAE,GAAG,uCAAkB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAC9C,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,UAAU,CAAC,aAAa,CACtB,2BAA2B,EAC3B,mCAAmC,CACpC,CAAC;YACF,OAAO;QACT,CAAC;QAED,0DAA0D;QAC1D,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC;IAED;;;;OAIG;IACH,WAAW,EAAE,CAAC,UAAyB,EAAE,KAA8B,EAAE,EAAE;QACzE,yDAAyD;QACzD,uCAAkB,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;IACxD,CAAC;CACF,CAAC","sourcesContent":["/**\r\n * exampleSingletonPmAdapter.ts\r\n * \r\n * This file demonstrates how to implement a Singleton PM Adapter to connect UI components\r\n * to singleton PMs. Singleton PM Adapters provide a standardized way for UI frameworks\r\n * to subscribe to singleton PM updates without needing to specify an AppObject ID.\r\n * \r\n * Key concepts:\r\n * - Singleton PM Adapters implement the SingletonPmAdapter<VM> interface\r\n * - They handle subscribing UI components to singleton PMs and unsubscribing when done\r\n * - They provide a default view model for initial rendering before data is available\r\n * - They don't require an AppObject ID since they connect to globally accessible singletons\r\n * \r\n * Usage pattern (React example):\r\n * ```typescript\r\n * // In a React component\r\n * function MyComponent() {\r\n * // Note: no ID needed since it's connecting to a singleton\r\n * const viewModel = useSingletonPmAdapter(exampleSingletonPmAdapter);\r\n * return <div>{viewModel.aBoolProperty ? \"True\" : \"False\"}</div>;\r\n * }\r\n * ```\r\n */\r\n\r\nimport { AppObjectRepo } from \"../../AppObject\";\r\nimport { SingletonPmAdapter } from \"../../Types/SingletonPmAdapter\";\r\nimport {\r\n defaultSlideNavigationVM,\r\n ExampleSingletonPM,\r\n ExampleVM\r\n} from \"../PMs/ExampleSingletonPM\";\r\n\r\n/**\r\n * An adapter that connects UI components to the ExampleSingletonPM.\r\n * Implements SingletonPmAdapter<ExampleVM> because ExampleSingletonPM provides ExampleVM view models.\r\n */\r\nexport const exampleSingletonPmAdapter: SingletonPmAdapter<ExampleVM> = {\r\n // Default view model to use before data is available\r\n defaultVM: defaultSlideNavigationVM,\r\n \r\n /**\r\n * Subscribes a UI component to updates from the ExampleSingletonPM\r\n * @param appObjects The application's AppObjectRepo\r\n * @param setVM Callback function that updates the UI component\r\n */\r\n subscribe: (appObjects: AppObjectRepo, setVM: (vm: ExampleVM) => void) => {\r\n // Find the singleton PM using its static get method\r\n const pm = ExampleSingletonPM.get(appObjects);\r\n if (!pm) {\r\n appObjects.submitWarning(\r\n \"exampleSingletonPmAdapter\",\r\n \"Unable to find ExampleSingletonPM\"\r\n );\r\n return;\r\n }\r\n \r\n // Register the UI component's callback to receive updates\r\n pm.addView(setVM);\r\n },\r\n \r\n /**\r\n * Unsubscribes a UI component from updates when it's no longer needed\r\n * @param appObjects The application's AppObjectRepo\r\n * @param setVM The same callback function that was used to subscribe\r\n */\r\n unsubscribe: (appObjects: AppObjectRepo, setVM: (vm: ExampleVM) => void) => {\r\n // Find the singleton PM and remove the view if it exists\r\n ExampleSingletonPM.get(appObjects)?.removeView(setVM);\r\n }\r\n};\r\n"]}
@@ -41,7 +41,7 @@ export const examplePmAdapter = {
41
41
  // Find the PM using the provided ID
42
42
  const pm = ExamplePM.getById(id, appObjects);
43
43
  if (!pm) {
44
- appObjects.submitError("examplePmAdapter", "Unable to find ExamplePM");
44
+ appObjects.submitWarning("examplePmAdapter", "Unable to find ExamplePM");
45
45
  return;
46
46
  }
47
47
  // Register the UI component's callback to receive updates
@@ -1 +1 @@
1
- {"version":3,"file":"examplePmAdapter.js","sourceRoot":"","sources":["../../../../src/ExampleFeature/Adapters/examplePmAdapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAsB;IACjD,qDAAqD;IACrD,SAAS,EAAE,EAAE;IAEb;;;;;OAKG;IACH,SAAS,EAAE,CACT,EAAU,EACV,UAAyB,EACzB,KAA2B,EAC3B,EAAE;QACF,oCAAoC;QACpC,IAAI,CAAC,EAAE;YAAE,OAAO;QAEhB,oCAAoC;QACpC,MAAM,EAAE,GAAG,SAAS,CAAC,OAAO,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;QAC7C,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,UAAU,CAAC,WAAW,CAAC,kBAAkB,EAAE,0BAA0B,CAAC,CAAC;YACvE,OAAO;QACT,CAAC;QAED,0DAA0D;QAC1D,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC;IAED;;;;;OAKG;IACH,WAAW,EAAE,CACX,EAAU,EACV,UAAyB,EACzB,KAA2B,EAC3B,EAAE;QACF,+CAA+C;QAC/C,SAAS,CAAC,OAAO,CAAC,EAAE,EAAE,UAAU,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;IACvD,CAAC;CACF,CAAC","sourcesContent":["/**\r\n * examplePmAdapter.ts\r\n * \r\n * This file demonstrates how to implement a PM Adapter to connect UI components to PMs.\r\n * PM Adapters provide a standardized way for UI frameworks to subscribe to PM updates.\r\n * This adapter connects to regular (non-singleton) PMs that require an AppObject ID.\r\n * \r\n * Key concepts:\r\n * - PM Adapters implement the PmAdapter<VM> interface where VM is the view model type\r\n * - They handle subscribing UI components to PMs and unsubscribing when done\r\n * - They provide a default view model for initial rendering before data is available\r\n * - They abstract away the details of finding and connecting to specific PMs\r\n * \r\n * Usage pattern (React example):\r\n * ```typescript\r\n * // In a React component\r\n * function MyComponent({ id }) {\r\n * const viewModel = usePmAdapter(examplePmAdapter, id);\r\n * return <div>{viewModel}</div>;\r\n * }\r\n * ```\r\n */\r\n\r\nimport { AppObjectRepo } from \"../../AppObject\";\r\nimport { PmAdapter } from \"../../Types/PmAdapter\";\r\nimport { ExamplePM } from \"../PMs/ExamplePM\";\r\n\r\n/**\r\n * An adapter that connects UI components to ExamplePM instances.\r\n * Implements PmAdapter<string> because ExamplePM provides string view models.\r\n */\r\nexport const examplePmAdapter: PmAdapter<string> = {\r\n // Default view model to use before data is available\r\n defaultVM: \"\",\r\n \r\n /**\r\n * Subscribes a UI component to updates from an ExamplePM\r\n * @param id The ID of the AppObject containing the PM\r\n * @param appObjects The application's AppObjectRepo\r\n * @param setVM Callback function that updates the UI component\r\n */\r\n subscribe: (\r\n id: string,\r\n appObjects: AppObjectRepo,\r\n setVM: (vm: string) => void\r\n ) => {\r\n // Return early if no ID is provided\r\n if (!id) return;\r\n\r\n // Find the PM using the provided ID\r\n const pm = ExamplePM.getById(id, appObjects);\r\n if (!pm) {\r\n appObjects.submitError(\"examplePmAdapter\", \"Unable to find ExamplePM\");\r\n return;\r\n }\r\n \r\n // Register the UI component's callback to receive updates\r\n pm.addView(setVM);\r\n },\r\n \r\n /**\r\n * Unsubscribes a UI component from updates when it's no longer needed\r\n * @param id The ID of the AppObject containing the PM\r\n * @param appObjects The application's AppObjectRepo\r\n * @param setVM The same callback function that was used to subscribe\r\n */\r\n unsubscribe: (\r\n id: string,\r\n appObjects: AppObjectRepo,\r\n setVM: (vm: string) => void\r\n ) => {\r\n // Find the PM and remove the view if it exists\r\n ExamplePM.getById(id, appObjects)?.removeView(setVM);\r\n }\r\n};\r\n"]}
1
+ {"version":3,"file":"examplePmAdapter.js","sourceRoot":"","sources":["../../../../src/ExampleFeature/Adapters/examplePmAdapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAsB;IACjD,qDAAqD;IACrD,SAAS,EAAE,EAAE;IAEb;;;;;OAKG;IACH,SAAS,EAAE,CACT,EAAU,EACV,UAAyB,EACzB,KAA2B,EAC3B,EAAE;QACF,oCAAoC;QACpC,IAAI,CAAC,EAAE;YAAE,OAAO;QAEhB,oCAAoC;QACpC,MAAM,EAAE,GAAG,SAAS,CAAC,OAAO,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;QAC7C,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,UAAU,CAAC,aAAa,CAAC,kBAAkB,EAAE,0BAA0B,CAAC,CAAC;YACzE,OAAO;QACT,CAAC;QAED,0DAA0D;QAC1D,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC;IAED;;;;;OAKG;IACH,WAAW,EAAE,CACX,EAAU,EACV,UAAyB,EACzB,KAA2B,EAC3B,EAAE;QACF,+CAA+C;QAC/C,SAAS,CAAC,OAAO,CAAC,EAAE,EAAE,UAAU,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;IACvD,CAAC;CACF,CAAC","sourcesContent":["/**\r\n * examplePmAdapter.ts\r\n * \r\n * This file demonstrates how to implement a PM Adapter to connect UI components to PMs.\r\n * PM Adapters provide a standardized way for UI frameworks to subscribe to PM updates.\r\n * This adapter connects to regular (non-singleton) PMs that require an AppObject ID.\r\n * \r\n * Key concepts:\r\n * - PM Adapters implement the PmAdapter<VM> interface where VM is the view model type\r\n * - They handle subscribing UI components to PMs and unsubscribing when done\r\n * - They provide a default view model for initial rendering before data is available\r\n * - They abstract away the details of finding and connecting to specific PMs\r\n * \r\n * Usage pattern (React example):\r\n * ```typescript\r\n * // In a React component\r\n * function MyComponent({ id }) {\r\n * const viewModel = usePmAdapter(examplePmAdapter, id);\r\n * return <div>{viewModel}</div>;\r\n * }\r\n * ```\r\n */\r\n\r\nimport { AppObjectRepo } from \"../../AppObject\";\r\nimport { PmAdapter } from \"../../Types/PmAdapter\";\r\nimport { ExamplePM } from \"../PMs/ExamplePM\";\r\n\r\n/**\r\n * An adapter that connects UI components to ExamplePM instances.\r\n * Implements PmAdapter<string> because ExamplePM provides string view models.\r\n */\r\nexport const examplePmAdapter: PmAdapter<string> = {\r\n // Default view model to use before data is available\r\n defaultVM: \"\",\r\n \r\n /**\r\n * Subscribes a UI component to updates from an ExamplePM\r\n * @param id The ID of the AppObject containing the PM\r\n * @param appObjects The application's AppObjectRepo\r\n * @param setVM Callback function that updates the UI component\r\n */\r\n subscribe: (\r\n id: string,\r\n appObjects: AppObjectRepo,\r\n setVM: (vm: string) => void\r\n ) => {\r\n // Return early if no ID is provided\r\n if (!id) return;\r\n\r\n // Find the PM using the provided ID\r\n const pm = ExamplePM.getById(id, appObjects);\r\n if (!pm) {\r\n appObjects.submitWarning(\"examplePmAdapter\", \"Unable to find ExamplePM\");\r\n return;\r\n }\r\n \r\n // Register the UI component's callback to receive updates\r\n pm.addView(setVM);\r\n },\r\n \r\n /**\r\n * Unsubscribes a UI component from updates when it's no longer needed\r\n * @param id The ID of the AppObject containing the PM\r\n * @param appObjects The application's AppObjectRepo\r\n * @param setVM The same callback function that was used to subscribe\r\n */\r\n unsubscribe: (\r\n id: string,\r\n appObjects: AppObjectRepo,\r\n setVM: (vm: string) => void\r\n ) => {\r\n // Find the PM and remove the view if it exists\r\n ExamplePM.getById(id, appObjects)?.removeView(setVM);\r\n }\r\n};\r\n"]}
@@ -38,7 +38,7 @@ export const exampleSingletonPmAdapter = {
38
38
  // Find the singleton PM using its static get method
39
39
  const pm = ExampleSingletonPM.get(appObjects);
40
40
  if (!pm) {
41
- appObjects.submitError("exampleSingletonPmAdapter", "Unable to find ExampleSingletonPM");
41
+ appObjects.submitWarning("exampleSingletonPmAdapter", "Unable to find ExampleSingletonPM");
42
42
  return;
43
43
  }
44
44
  // Register the UI component's callback to receive updates
@@ -1 +1 @@
1
- {"version":3,"file":"exampleSingletonPmAdapter.js","sourceRoot":"","sources":["../../../../src/ExampleFeature/Adapters/exampleSingletonPmAdapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAIH,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAEnB,MAAM,2BAA2B,CAAC;AAEnC;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAkC;IACtE,qDAAqD;IACrD,SAAS,EAAE,wBAAwB;IAEnC;;;;OAIG;IACH,SAAS,EAAE,CAAC,UAAyB,EAAE,KAA8B,EAAE,EAAE;QACvE,oDAAoD;QACpD,MAAM,EAAE,GAAG,kBAAkB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAC9C,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,UAAU,CAAC,WAAW,CACpB,2BAA2B,EAC3B,mCAAmC,CACpC,CAAC;YACF,OAAO;QACT,CAAC;QAED,0DAA0D;QAC1D,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC;IAED;;;;OAIG;IACH,WAAW,EAAE,CAAC,UAAyB,EAAE,KAA8B,EAAE,EAAE;QACzE,yDAAyD;QACzD,kBAAkB,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;IACxD,CAAC;CACF,CAAC","sourcesContent":["/**\r\n * exampleSingletonPmAdapter.ts\r\n * \r\n * This file demonstrates how to implement a Singleton PM Adapter to connect UI components\r\n * to singleton PMs. Singleton PM Adapters provide a standardized way for UI frameworks\r\n * to subscribe to singleton PM updates without needing to specify an AppObject ID.\r\n * \r\n * Key concepts:\r\n * - Singleton PM Adapters implement the SingletonPmAdapter<VM> interface\r\n * - They handle subscribing UI components to singleton PMs and unsubscribing when done\r\n * - They provide a default view model for initial rendering before data is available\r\n * - They don't require an AppObject ID since they connect to globally accessible singletons\r\n * \r\n * Usage pattern (React example):\r\n * ```typescript\r\n * // In a React component\r\n * function MyComponent() {\r\n * // Note: no ID needed since it's connecting to a singleton\r\n * const viewModel = useSingletonPmAdapter(exampleSingletonPmAdapter);\r\n * return <div>{viewModel.aBoolProperty ? \"True\" : \"False\"}</div>;\r\n * }\r\n * ```\r\n */\r\n\r\nimport { AppObjectRepo } from \"../../AppObject\";\r\nimport { SingletonPmAdapter } from \"../../Types/SingletonPmAdapter\";\r\nimport {\r\n defaultSlideNavigationVM,\r\n ExampleSingletonPM,\r\n ExampleVM\r\n} from \"../PMs/ExampleSingletonPM\";\r\n\r\n/**\r\n * An adapter that connects UI components to the ExampleSingletonPM.\r\n * Implements SingletonPmAdapter<ExampleVM> because ExampleSingletonPM provides ExampleVM view models.\r\n */\r\nexport const exampleSingletonPmAdapter: SingletonPmAdapter<ExampleVM> = {\r\n // Default view model to use before data is available\r\n defaultVM: defaultSlideNavigationVM,\r\n \r\n /**\r\n * Subscribes a UI component to updates from the ExampleSingletonPM\r\n * @param appObjects The application's AppObjectRepo\r\n * @param setVM Callback function that updates the UI component\r\n */\r\n subscribe: (appObjects: AppObjectRepo, setVM: (vm: ExampleVM) => void) => {\r\n // Find the singleton PM using its static get method\r\n const pm = ExampleSingletonPM.get(appObjects);\r\n if (!pm) {\r\n appObjects.submitError(\r\n \"exampleSingletonPmAdapter\",\r\n \"Unable to find ExampleSingletonPM\"\r\n );\r\n return;\r\n }\r\n \r\n // Register the UI component's callback to receive updates\r\n pm.addView(setVM);\r\n },\r\n \r\n /**\r\n * Unsubscribes a UI component from updates when it's no longer needed\r\n * @param appObjects The application's AppObjectRepo\r\n * @param setVM The same callback function that was used to subscribe\r\n */\r\n unsubscribe: (appObjects: AppObjectRepo, setVM: (vm: ExampleVM) => void) => {\r\n // Find the singleton PM and remove the view if it exists\r\n ExampleSingletonPM.get(appObjects)?.removeView(setVM);\r\n }\r\n};\r\n"]}
1
+ {"version":3,"file":"exampleSingletonPmAdapter.js","sourceRoot":"","sources":["../../../../src/ExampleFeature/Adapters/exampleSingletonPmAdapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAIH,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAEnB,MAAM,2BAA2B,CAAC;AAEnC;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAkC;IACtE,qDAAqD;IACrD,SAAS,EAAE,wBAAwB;IAEnC;;;;OAIG;IACH,SAAS,EAAE,CAAC,UAAyB,EAAE,KAA8B,EAAE,EAAE;QACvE,oDAAoD;QACpD,MAAM,EAAE,GAAG,kBAAkB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAC9C,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,UAAU,CAAC,aAAa,CACtB,2BAA2B,EAC3B,mCAAmC,CACpC,CAAC;YACF,OAAO;QACT,CAAC;QAED,0DAA0D;QAC1D,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC;IAED;;;;OAIG;IACH,WAAW,EAAE,CAAC,UAAyB,EAAE,KAA8B,EAAE,EAAE;QACzE,yDAAyD;QACzD,kBAAkB,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;IACxD,CAAC;CACF,CAAC","sourcesContent":["/**\r\n * exampleSingletonPmAdapter.ts\r\n * \r\n * This file demonstrates how to implement a Singleton PM Adapter to connect UI components\r\n * to singleton PMs. Singleton PM Adapters provide a standardized way for UI frameworks\r\n * to subscribe to singleton PM updates without needing to specify an AppObject ID.\r\n * \r\n * Key concepts:\r\n * - Singleton PM Adapters implement the SingletonPmAdapter<VM> interface\r\n * - They handle subscribing UI components to singleton PMs and unsubscribing when done\r\n * - They provide a default view model for initial rendering before data is available\r\n * - They don't require an AppObject ID since they connect to globally accessible singletons\r\n * \r\n * Usage pattern (React example):\r\n * ```typescript\r\n * // In a React component\r\n * function MyComponent() {\r\n * // Note: no ID needed since it's connecting to a singleton\r\n * const viewModel = useSingletonPmAdapter(exampleSingletonPmAdapter);\r\n * return <div>{viewModel.aBoolProperty ? \"True\" : \"False\"}</div>;\r\n * }\r\n * ```\r\n */\r\n\r\nimport { AppObjectRepo } from \"../../AppObject\";\r\nimport { SingletonPmAdapter } from \"../../Types/SingletonPmAdapter\";\r\nimport {\r\n defaultSlideNavigationVM,\r\n ExampleSingletonPM,\r\n ExampleVM\r\n} from \"../PMs/ExampleSingletonPM\";\r\n\r\n/**\r\n * An adapter that connects UI components to the ExampleSingletonPM.\r\n * Implements SingletonPmAdapter<ExampleVM> because ExampleSingletonPM provides ExampleVM view models.\r\n */\r\nexport const exampleSingletonPmAdapter: SingletonPmAdapter<ExampleVM> = {\r\n // Default view model to use before data is available\r\n defaultVM: defaultSlideNavigationVM,\r\n \r\n /**\r\n * Subscribes a UI component to updates from the ExampleSingletonPM\r\n * @param appObjects The application's AppObjectRepo\r\n * @param setVM Callback function that updates the UI component\r\n */\r\n subscribe: (appObjects: AppObjectRepo, setVM: (vm: ExampleVM) => void) => {\r\n // Find the singleton PM using its static get method\r\n const pm = ExampleSingletonPM.get(appObjects);\r\n if (!pm) {\r\n appObjects.submitWarning(\r\n \"exampleSingletonPmAdapter\",\r\n \"Unable to find ExampleSingletonPM\"\r\n );\r\n return;\r\n }\r\n \r\n // Register the UI component's callback to receive updates\r\n pm.addView(setVM);\r\n },\r\n \r\n /**\r\n * Unsubscribes a UI component from updates when it's no longer needed\r\n * @param appObjects The application's AppObjectRepo\r\n * @param setVM The same callback function that was used to subscribe\r\n */\r\n unsubscribe: (appObjects: AppObjectRepo, setVM: (vm: ExampleVM) => void) => {\r\n // Find the singleton PM and remove the view if it exists\r\n ExampleSingletonPM.get(appObjects)?.removeView(setVM);\r\n }\r\n};\r\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vived/core",
3
- "version": "1.4.4",
3
+ "version": "1.4.5",
4
4
  "description": "Core Components for VIVED Apps and Hosts",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",