@memberjunction/interactive-component-types 2.71.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.
@@ -0,0 +1,72 @@
1
+ import { ComponentEvent, ComponentProperty } from "./component-props-events";
2
+ import { ComponentDataRequirements } from "./data-requirements";
3
+ /**
4
+ * Represents a child component within a component hierarchy
5
+ */
6
+ export interface ComponentChildSpec {
7
+ /**
8
+ * The programmatic name of the component
9
+ */
10
+ componentName: string;
11
+ /**
12
+ * Example of the component being used in JSX format. This is used to provide a clear example on the properties and
13
+ * event handling that the component supports. This is used to teach the next AI exactly what we want it to generate for the
14
+ * child component.
15
+ */
16
+ exampleUsage: string;
17
+ /**
18
+ * The code for the child component. This is generated LATER by a separate process after the parent
19
+ * component generation is complete. When the parent component generates this is undefined.
20
+ */
21
+ componentCode?: string;
22
+ /**
23
+ * A summary of what this child component does that a user would understand.
24
+ * This should be a high-level, user-friendly description suitable for end users.
25
+ */
26
+ description: string;
27
+ /**
28
+ * Functional requirements for this child component.
29
+ * This should be in markdown format and describe what the component should do from a functional perspective.
30
+ * Includes:
31
+ * - Component-specific functionality
32
+ * - How it integrates with the parent component
33
+ * - User interactions within this component
34
+ * - Business rules specific to this component
35
+ */
36
+ functionalRequirements?: string;
37
+ /**
38
+ * Data requirements for this child component. This section defines where a child component
39
+ * will **directly** access data as required using utilities methods like `rv.runView` and `rq.runQuery`
40
+ */
41
+ dataRequirements?: ComponentDataRequirements;
42
+ /**
43
+ * An optional array of properties that the component uses. The names and descriptions
44
+ * allow consumers of the component to understand what is accepted by the component and the
45
+ * component. This can be used for shared data shared between components or for configuration
46
+ * settings.
47
+ */
48
+ properties?: ComponentProperty[];
49
+ /**
50
+ * An optional array of events that the component emits.
51
+ * This allows consumers of the component to understand what events they can listen to.
52
+ */
53
+ events?: ComponentEvent[];
54
+ /**
55
+ * Technical design details for this child component.
56
+ * This should be in markdown format and describe the implementation approach.
57
+ * Includes:
58
+ * - How the component is structured
59
+ * - State within the component
60
+ * - Properites/events
61
+ */
62
+ technicalDesign?: string;
63
+ /**
64
+ * The path in the state tree where this component's state is stored
65
+ */
66
+ statePath: string;
67
+ /**
68
+ * An array of sub-components
69
+ */
70
+ components: ComponentChildSpec[];
71
+ }
72
+ //# sourceMappingURL=child-spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"child-spec.d.ts","sourceRoot":"","sources":["../src/child-spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;;;;OAQG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAEhC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,yBAAyB,CAAC;IAE7C;;;;;OAKG;IACH,UAAU,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAEjC;;;OAGG;IACH,MAAM,CAAC,EAAE,cAAc,EAAE,CAAC;IAE1B;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,UAAU,EAAE,kBAAkB,EAAE,CAAC;CACpC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=child-spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"child-spec.js","sourceRoot":"","sources":["../src/child-spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,32 @@
1
+ import { ComponentRootSpec } from "./root-spec";
2
+ /**
3
+ * Defines a given option for a generated component that the user can choose. The code/componentObjectName properties are used to render the component in the UI.
4
+ */
5
+ export type ComponentOption = {
6
+ /**
7
+ * Full details of the generated component option including functional, technical, code, and child componentry.
8
+ */
9
+ option: ComponentRootSpec;
10
+ /**
11
+ * If multiple component options are provided a "judge" AI will evaluate all the functional
12
+ * responses and will rank order them with an explanation of why they were each ranked that way. Rankings are not absolute, they are relative to the
13
+ * # of components contained within an array of ComponentOption types.
14
+ */
15
+ AIRank: number | undefined;
16
+ /**
17
+ * The AI's explanation of why it ranked the component the way it did. This is useful for understanding the AI's reasoning and can be used to improve future components
18
+ * as well as provide context to the user about why a particular component was chosen as the best option.
19
+ */
20
+ AIRankExplanation: string | undefined;
21
+ /**
22
+ * The user's provided feedback on the component option. Unlike the AIRank, this is a subjective rating provided by the user and is
23
+ * a number between 1 and 10, where 1 is the lowest rating and 10 is the highest rating.
24
+ */
25
+ UserRank: number | undefined;
26
+ /**
27
+ * If the host application provides a way for the user to provide feedback on the component option,
28
+ * this is the explanation of why the user rated the component the way they did if they provided feedback.
29
+ */
30
+ UserRankExplanation: string | undefined;
31
+ };
32
+ //# sourceMappingURL=component-option.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-option.d.ts","sourceRoot":"","sources":["../src/component-option.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC1B;;OAEG;IACH,MAAM,EAAE,iBAAiB,CAAC;IAE1B;;;;OAIG;IACH,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B;;;OAGG;IACH,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC;;;OAGG;IACH,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B;;;OAGG;IACH,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3C,CAAA"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=component-option.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-option.js","sourceRoot":"","sources":["../src/component-option.ts"],"names":[],"mappings":""}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Definition of a single property of a component.
3
+ */
4
+ export interface ComponentProperty {
5
+ /**
6
+ * The name of the property
7
+ */
8
+ name: string;
9
+ /**
10
+ * A description of what this property is used for
11
+ */
12
+ description: string;
13
+ /**
14
+ * The type of the property.
15
+ * It can be one of 'string', 'number', 'boolean', 'object', 'array', 'function', or 'any'.
16
+ * These types are for aligning users of the component. Components are in JavaScript and do not
17
+ * actually enforce types at runtime, but this is used to provide guidance for users (AI and Human)
18
+ */
19
+ type: 'string' | 'number' | 'boolean' | 'object' | 'array' | 'function' | 'any';
20
+ /**
21
+ * Indicates if this property is required for the component to function correctly.
22
+ * If true, the component will not work without this property being set.
23
+ */
24
+ required: boolean;
25
+ /**
26
+ * The default value, if any, for this property if it is not provided.
27
+ */
28
+ defaultValue?: any;
29
+ /**
30
+ * Optional list of possible values for this property.
31
+ */
32
+ possibleValues?: string[];
33
+ }
34
+ /**
35
+ * Definition of a single event of a component.
36
+ */
37
+ export interface ComponentEvent {
38
+ /**
39
+ * The name of the event
40
+ */
41
+ name: string;
42
+ /**
43
+ * A description of what this event does
44
+ */
45
+ description: string;
46
+ /**
47
+ * An array of parameters that this event can emit.
48
+ */
49
+ parameters?: ComponentEventParameter[];
50
+ }
51
+ export interface ComponentEventParameter {
52
+ /**
53
+ * The name of the parameter
54
+ */
55
+ name: string;
56
+ /**
57
+ * A description of what this parameter is used for
58
+ */
59
+ description: string;
60
+ /**
61
+ * The type of the parameter.
62
+ * It can be one of 'string', 'number', 'boolean', 'object', 'array', 'function', or 'any'.
63
+ */
64
+ type: 'string' | 'number' | 'boolean' | 'object' | 'array' | 'function' | 'any';
65
+ }
66
+ //# sourceMappingURL=component-props-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-props-events.d.ts","sourceRoot":"","sources":["../src/component-props-events.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAC9B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,KAAK,CAAC;IAChF;;;OAGG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,UAAU,CAAC,EAAE,uBAAuB,EAAE,CAAC;CAC1C;AAED,MAAM,WAAW,uBAAuB;IACpC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,KAAK,CAAC;CACnF"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=component-props-events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-props-events.js","sourceRoot":"","sources":["../src/component-props-events.ts"],"names":[],"mappings":""}
@@ -0,0 +1,77 @@
1
+ import { DataContext } from "@memberjunction/data-context";
2
+ /**
3
+ * This interface is critical for understanding how components interact with MemberJunction data
4
+ */
5
+ export interface ComponentDataRequirements {
6
+ /**
7
+ * The primary data access mode for this component.
8
+ * - 'dynamic': Component fetches data at runtime using MJ utilities
9
+ * - 'static': Deprecated, use dynamic.
10
+ * - 'hybrid': Deprecated, use dynamic.
11
+ */
12
+ mode: 'static' | 'dynamic' | 'hybrid';
13
+ /**
14
+ * For static mode: References to data context items that this component uses.
15
+ * These are pre-loaded data snapshots that are passed to the component during initialization.
16
+ * @deprecated Use dynamicData instead
17
+ */
18
+ staticData?: {
19
+ /**
20
+ * Reference to the data context that this component uses.
21
+ */
22
+ dataContext: DataContext;
23
+ /**
24
+ * Description of how the static data is used by the component
25
+ */
26
+ description?: string;
27
+ };
28
+ /**
29
+ * For dynamic mode: Defines which MemberJunction entities this component needs access to.
30
+ * The component will use the RunView/RunQuery utilities to fetch data at runtime.
31
+ */
32
+ dynamicData?: {
33
+ /**
34
+ * Describes the entities and fields the component will
35
+ * need to fulfill user requirements.
36
+ */
37
+ requiredEntities: ComponentEntityDataRequirement[];
38
+ /**
39
+ * Description of data access patterns
40
+ */
41
+ description?: string;
42
+ };
43
+ /**
44
+ * General description of data requirements
45
+ */
46
+ description?: string;
47
+ }
48
+ /**
49
+ * Describes use of a single entity
50
+ */
51
+ export type ComponentEntityDataRequirement = {
52
+ /**
53
+ * Name of the entity (unique system-wide)
54
+ */
55
+ entityName: string;
56
+ /**
57
+ * Description of data in the entity
58
+ */
59
+ entityDescription?: string;
60
+ /**
61
+ * Fields to show the user
62
+ */
63
+ displayFields: string[];
64
+ /**
65
+ * Fields to filter on initially or via user interaction.
66
+ */
67
+ filterFields?: string[];
68
+ /**
69
+ * Fields to use when sorting
70
+ */
71
+ sortFields?: string[];
72
+ /**
73
+ * When/Where/How components should use this data
74
+ */
75
+ usageContext?: string;
76
+ };
77
+ //# sourceMappingURL=data-requirements.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-requirements.d.ts","sourceRoot":"","sources":["../src/data-requirements.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACtC;;;;;OAKG;IACH,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;IAEtC;;;;OAIG;IACH,UAAU,CAAC,EAAE;QACT;;WAEG;QACH,WAAW,EAAE,WAAW,CAAC;QAEzB;;WAEG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;IAEF;;;OAGG;IACH,WAAW,CAAC,EAAE;QACV;;;WAGG;QACH,gBAAgB,EAAE,8BAA8B,EAAE,CAAC;QAEnD;;WAEG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;IAEF;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,MAAM,8BAA8B,GAAG;IACzC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,aAAa,EAAE,MAAM,EAAE,CAAC;IAExB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAExB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAEtB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB,CAAA"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=data-requirements.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-requirements.js","sourceRoot":"","sources":["../src/data-requirements.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ export * from './root-spec';
2
+ export * from './child-spec';
3
+ export * from './data-requirements';
4
+ export * from './component-option';
5
+ export * from './runtime-types';
6
+ export * from './shared';
7
+ export * from './component-props-events';
8
+ export * from './util';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,0BAA0B,CAAC;AACzC,cAAc,QAAQ,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./root-spec"), exports);
18
+ __exportStar(require("./child-spec"), exports);
19
+ __exportStar(require("./data-requirements"), exports);
20
+ __exportStar(require("./component-option"), exports);
21
+ __exportStar(require("./runtime-types"), exports);
22
+ __exportStar(require("./shared"), exports);
23
+ __exportStar(require("./component-props-events"), exports);
24
+ __exportStar(require("./util"), exports);
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,+CAA6B;AAC7B,sDAAoC;AACpC,qDAAmC;AACnC,kDAAgC;AAChC,2CAAyB;AACzB,2DAAyC;AACzC,yCAAuB"}
@@ -0,0 +1,72 @@
1
+ import { ComponentChildSpec } from "./child-spec";
2
+ import { ComponentDataRequirements } from "./data-requirements";
3
+ /**
4
+ * Represents a complete specification for a generated Skip component, including its structure,
5
+ * requirements, code, and nested component hierarchy
6
+ */
7
+ export type ComponentRootSpec = {
8
+ /**
9
+ * A description of what the component should do from a functional perspective.
10
+ * This should be in markdown format and include:
11
+ * - Core functionality
12
+ * - Business rules
13
+ * - Expected outcomes
14
+ * - UX considerations
15
+ */
16
+ functionalRequirements: string;
17
+ /**
18
+ * Detailed data requirements, including how the component accesses and uses data.
19
+ */
20
+ dataRequirements?: ComponentDataRequirements;
21
+ /**
22
+ * A technical description of how the component is designed and implemented.
23
+ * This should be in markdown format and include:
24
+ * - Architecture and design patterns
25
+ * - Key technical decisions
26
+ * - Component structure
27
+ * - State management
28
+ * - Integration points with parent/child components
29
+ */
30
+ technicalDesign: string;
31
+ /**
32
+ * The code for the main component.
33
+ */
34
+ componentCode: string;
35
+ /**
36
+ * Name of the component
37
+ */
38
+ componentName: string;
39
+ /**
40
+ * The type of component: report, dashboard, form, or other.
41
+ */
42
+ componentType: "report" | "dashboard" | "form" | "other";
43
+ /**
44
+ * A summary of what the component does that a user would understand.
45
+ */
46
+ description: string;
47
+ /**
48
+ * The callback strategy used by this component (e.g., "hybrid", "direct", "none")
49
+ */
50
+ callbackStrategy: string;
51
+ /**
52
+ * Describes the state structure managed by this component
53
+ */
54
+ stateStructure: Record<string, string>;
55
+ /**
56
+ * An array of child component specifications
57
+ */
58
+ childComponents: ComponentChildSpec[];
59
+ /**
60
+ * User-friendly name
61
+ */
62
+ title: string;
63
+ /**
64
+ * A user-friendly explanation of what the component does
65
+ */
66
+ userExplanation: string;
67
+ /**
68
+ * Summary of technical design
69
+ */
70
+ techExplanation: string;
71
+ };
72
+ //# sourceMappingURL=root-spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root-spec.d.ts","sourceRoot":"","sources":["../src/root-spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAEhE;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC5B;;;;;;;OAOG;IACH,sBAAsB,EAAE,MAAM,CAAC;IAE/B;;OAEG;IACH,gBAAgB,CAAC,EAAE,yBAAyB,CAAC;IAE7C;;;;;;;;OAQG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,aAAa,EAAE,QAAQ,GAAG,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC;IAEzD;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEvC;;OAEG;IACH,eAAe,EAAE,kBAAkB,EAAE,CAAC;IAEtC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;CAC3B,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=root-spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root-spec.js","sourceRoot":"","sources":["../src/root-spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,203 @@
1
+ import { CompositeKey } from "@memberjunction/core";
2
+ import { SimpleDataContext, SimpleMetadata, SimpleRunQuery, SimpleRunView } from "./shared";
3
+ /**
4
+ * Callbacks a component can use.
5
+ */
6
+ export interface ComponentCallbacks {
7
+ /**
8
+ * When data is provided by the parent, this request results in the parent restarting the component. Only relevant for static/hybrid data, not for dynamic.
9
+ * @deprecated
10
+ */
11
+ RefreshData: () => void;
12
+ /**
13
+ * If an action occurs inside a component where it would be desirable for the containing UI to open a specific
14
+ * record, if supported, this event can be listened to and the container UI can then open the record.
15
+ * @param entityName - this is the Entity NAME from the Entity metadata, not the table name or base view name. Use Entity Metadata to provide the entity name here
16
+ * @param key - this is an array of key/value pairs representing the primary key. The format of a Composite Key is an array of KeyValuePair objects and KeyValuePair objects simply have FieldName and Value properties. In most cases entities have single-valued primary keys but this structure is here for complex entity types that have composite primary keys
17
+ */
18
+ OpenEntityRecord: (entityName: string, key: CompositeKey) => void;
19
+ /**
20
+ * This event should be raised whenever something changes within the component that should be tracked as a change in state
21
+ * that will persist. userState is any valid serializable JavaScript object. This state is passed to the component when it
22
+ * initializes.
23
+ */
24
+ UpdateUserState: (userState: any) => void;
25
+ /**
26
+ * Other notifications that a component might want to send to the parent.
27
+ */
28
+ NotifyEvent: (eventName: string, eventData: any) => void;
29
+ }
30
+ /**
31
+ * Function signature for the initialization function of each component.
32
+ * This function is called when the component is loaded by its container. The function receives the data context, an optional userState property, and a set of callbacks that can be used to interact with the parent component.
33
+ * userState is an optional parameter that can be used to pass in any state information that the parent component wants to provide to the component that is specific
34
+ * to the CURRENT user. If the component modifies the userState, it should notify the parent component via the UserStateChanged event in the callbacks object so that the parent component can handle storage.
35
+ */
36
+ export type ComponentInitFunction = (params: ComponentInitParams) => void;
37
+ /**
38
+ * This is the function signature for the print function that is provided by the component via the SkipComponentObject
39
+ */
40
+ export type ComponentPrintFunction = () => void;
41
+ /**
42
+ * This is the function signature for the refresh function that is provided by the component via the SkipComponentObject
43
+ */
44
+ export type ComponentRefreshFunction = () => void;
45
+ /**
46
+ * Parameters that are passed to the SkipComponentInitFunction when it is called by the parent component.
47
+ */
48
+ export interface ComponentInitParams {
49
+ /**
50
+ * Contains the static data specified by the root component specification. This data is pre-loaded and passed to
51
+ * the component during initialization and anytime the component is refreshed.
52
+ */
53
+ staticData: SimpleDataContext;
54
+ /**
55
+ * Contains dynamic data and metadata utilities to access the host MJ system.
56
+ */
57
+ utilities?: ComponentUtilities;
58
+ /**
59
+ * Any serializable JS object, represents the user-specific state.
60
+ */
61
+ userState?: any;
62
+ /**
63
+ * Callbacks that the component can use to interact with its parent. Allows the component to refresh data, open records, update user state, and send custom events.
64
+ */
65
+ callbacks?: ComponentCallbacks;
66
+ /**
67
+ * Styles the component should use as specified by its parent/container. The component can alter these styles based on the requirements specified by the requirements.
68
+ */
69
+ styles?: ComponentStyles;
70
+ }
71
+ /**
72
+ * Defines styles for the component. Container can provide styles to a top level component. The top level component
73
+ * can alter these styles based on the design documentation. Top level component will pass in its computed styles to
74
+ * each sub-component and in turn sub-components do the same recursively down to all levels. Allows sub-components to inherit styles but
75
+ * also make adjustments as required by the design documentation.
76
+ */
77
+ export interface ComponentStyles {
78
+ colors: {
79
+ primary: string;
80
+ primaryHover: string;
81
+ primaryLight?: string;
82
+ secondary: string;
83
+ secondaryHover?: string;
84
+ success: string;
85
+ successLight?: string;
86
+ warning?: string;
87
+ warningLight?: string;
88
+ error?: string;
89
+ errorLight?: string;
90
+ info?: string;
91
+ infoLight?: string;
92
+ background: string;
93
+ surface: string;
94
+ surfaceHover?: string;
95
+ text: string;
96
+ textSecondary: string;
97
+ textTertiary?: string;
98
+ textInverse?: string;
99
+ border: string;
100
+ borderLight?: string;
101
+ borderFocus?: string;
102
+ shadow?: string;
103
+ shadowMedium?: string;
104
+ shadowLarge?: string;
105
+ [key: string]: string | undefined;
106
+ };
107
+ spacing: {
108
+ xs: string;
109
+ sm: string;
110
+ md: string;
111
+ lg: string;
112
+ xl: string;
113
+ xxl?: string;
114
+ xxxl?: string;
115
+ [key: string]: string | undefined;
116
+ };
117
+ typography: {
118
+ fontFamily: string;
119
+ fontSize: {
120
+ xs?: string;
121
+ sm: string;
122
+ md: string;
123
+ lg: string;
124
+ xl: string;
125
+ xxl?: string;
126
+ xxxl?: string;
127
+ [key: string]: string | undefined;
128
+ };
129
+ fontWeight?: {
130
+ light?: string;
131
+ regular?: string;
132
+ medium?: string;
133
+ semibold?: string;
134
+ bold?: string;
135
+ [key: string]: string | undefined;
136
+ };
137
+ lineHeight?: {
138
+ tight?: string;
139
+ normal?: string;
140
+ relaxed?: string;
141
+ [key: string]: string | undefined;
142
+ };
143
+ };
144
+ borders: {
145
+ radius: string | {
146
+ sm?: string;
147
+ md?: string;
148
+ lg?: string;
149
+ xl?: string;
150
+ full?: string;
151
+ [key: string]: string | undefined;
152
+ };
153
+ width: string | {
154
+ thin?: string;
155
+ medium?: string;
156
+ thick?: string;
157
+ [key: string]: string | undefined;
158
+ };
159
+ };
160
+ shadows?: {
161
+ sm?: string;
162
+ md?: string;
163
+ lg?: string;
164
+ xl?: string;
165
+ inner?: string;
166
+ [key: string]: string | undefined;
167
+ };
168
+ transitions?: {
169
+ fast?: string;
170
+ normal?: string;
171
+ slow?: string;
172
+ [key: string]: string | undefined;
173
+ };
174
+ overflow: string;
175
+ }
176
+ /**
177
+ * The component will create this object and it will include the members defined in this interface and return upon its main function being called.
178
+ */
179
+ export interface ComponentObject {
180
+ /**
181
+ * This component receives props including data, userState, callbacks, utilities, and styles.
182
+ */
183
+ component: any;
184
+ /**
185
+ * The optional print function that is called when the user clicks on the print button in the parent of the component. This function will never be called by the parent before the init function so the print function
186
+ * can assume the component has been initialized;
187
+ */
188
+ print?: ComponentPrintFunction;
189
+ /**
190
+ * The optional refresh function that is called when the user clicks on the refresh button in the parent of the component. This function will never be called by the parent before the init function so the refresh function
191
+ */
192
+ refresh?: ComponentRefreshFunction;
193
+ }
194
+ /**
195
+ * This interface defines the utilities that are available to the component at runtime. These utilities are used to interact with the host MJ system to
196
+ * retrieve metadata, run views, and run queries. The utilities are passed into the ComponentInitFunction by the container.
197
+ */
198
+ export interface ComponentUtilities {
199
+ md: SimpleMetadata;
200
+ rv: SimpleRunView;
201
+ rq: SimpleRunQuery;
202
+ }
203
+ //# sourceMappingURL=runtime-types.d.ts.map
@@ -0,0 +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CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;SACnC,CAAC;KACL,CAAA;IACD,OAAO,CAAC,EAAE;QACN,EAAE,CAAC,EAAE,MAAM,CAAA;QACX,EAAE,CAAC,EAAE,MAAM,CAAA;QACX,EAAE,CAAC,EAAE,MAAM,CAAA;QACX,EAAE,CAAC,EAAE,MAAM,CAAA;QACX,KAAK,CAAC,EAAE,MAAM,CAAA;QAGd,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;KACrC,CAAA;IACD,WAAW,CAAC,EAAE;QACV,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,IAAI,CAAC,EAAE,MAAM,CAAA;QAGb,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;KACrC,CAAA;IACD,QAAQ,EAAE,MAAM,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B;;OAEG;IACH,SAAS,EAAE,GAAG,CAAC;IAEf;;;OAGG;IACH,KAAK,CAAC,EAAE,sBAAsB,CAAC;IAE/B;;OAEG;IACH,OAAO,CAAC,EAAE,wBAAwB,CAAC;CACtC;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IAC/B,EAAE,EAAE,cAAc,CAAC;IACnB,EAAE,EAAE,aAAa,CAAC;IAClB,EAAE,EAAE,cAAc,CAAA;CACrB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=runtime-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-types.js","sourceRoot":"","sources":["../src/runtime-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,50 @@
1
+ import { BaseEntity, EntityInfo, RunQueryParams, RunQueryResult, RunViewParams, RunViewResult } from "@memberjunction/core";
2
+ /**
3
+ * This is a simple data context object that is passed into the ComponentInitFunction containing any required `static` data. This object is empty when the mode is `dynamic`
4
+ */
5
+ export type SimpleDataContext = {
6
+ [key: string]: any;
7
+ };
8
+ /**
9
+ * Access system metadata and get entity objects to do CRUD operations on entities.
10
+ */
11
+ export interface SimpleMetadata {
12
+ /**
13
+ * Array of entity metadata objects that describe the entities in the system.
14
+ */
15
+ Entities: EntityInfo[];
16
+ /**
17
+ * Retrieves a single BaseEntity derived class for the specified entity
18
+ * @param entityName
19
+ */
20
+ GetEntityObject(entityName: string): Promise<BaseEntity>;
21
+ }
22
+ /**
23
+ * Simple interface for running views in MJ
24
+ */
25
+ export interface SimpleRunView {
26
+ /**
27
+ * Run a single view and return the results. The view is run dynamically against the MemberJunction host environment.
28
+ * @param params
29
+ * @returns
30
+ */
31
+ RunView: (params: RunViewParams) => Promise<RunViewResult>;
32
+ /**
33
+ * Runs multiple views and returns the results. This is efficient for running views in **parallel**.
34
+ * @param params
35
+ * @returns
36
+ */
37
+ RunViews: (params: RunViewParams[]) => Promise<RunViewResult[]>;
38
+ }
39
+ /**
40
+ * Simple interface for running predefined queries in MJ
41
+ */
42
+ export interface SimpleRunQuery {
43
+ /**
44
+ * Run a single predefined query.
45
+ * @param params
46
+ * @returns
47
+ */
48
+ RunQuery: (params: RunQueryParams) => Promise<RunQueryResult>;
49
+ }
50
+ //# sourceMappingURL=shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE5H;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB,CAAA;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B;;OAEG;IACH,QAAQ,EAAE,UAAU,EAAE,CAAC;IACvB;;;OAGG;IACH,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CAC5D;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B;;;;OAIG;IACH,OAAO,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,OAAO,CAAC,aAAa,CAAC,CAAA;IAC1D;;;;OAIG;IACH,QAAQ,EAAE,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,OAAO,CAAC,aAAa,EAAE,CAAC,CAAA;CAClE;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B;;;;OAIG;IACH,QAAQ,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,OAAO,CAAC,cAAc,CAAC,CAAA;CAChE"}
package/dist/shared.js ADDED
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.js","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":""}
package/dist/util.d.ts ADDED
@@ -0,0 +1,21 @@
1
+ import { ComponentChildSpec } from "./child-spec";
2
+ import { ComponentRootSpec } from "./root-spec";
3
+ /**
4
+ * Builds the complete code for a component based on the provided spec.
5
+ *
6
+ * This function generates the full code representation of a component, including
7
+ * the root component code and recursively pulling in child components and also replacing
8
+ * the placeholders for those child components in the parent component's code with the
9
+ * actual code for those child components (which were generated after the parent component was generated).
10
+ *
11
+ * @param spec - The ComponentRootSpec defining the component structure and behavior
12
+ * @returns A string containing the complete executable JavaScript code for the component
13
+ */
14
+ export declare function BuildComponentCompleteCode(spec: ComponentRootSpec): string;
15
+ /**
16
+ * Builds the code for a component child based on the provided spec including recursive child components.
17
+ * @param spec - The ComponentChildSpec defining the child component structure and behavior
18
+ * @returns A string containing the executable JavaScript code for the component child
19
+ */
20
+ export declare function BuildComponentChildCode(child: ComponentChildSpec, path: string): string;
21
+ //# sourceMappingURL=util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD;;;;;;;;;;GAUG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAiB1E;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAkBvF"}
package/dist/util.js ADDED
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BuildComponentChildCode = exports.BuildComponentCompleteCode = void 0;
4
+ /**
5
+ * Builds the complete code for a component based on the provided spec.
6
+ *
7
+ * This function generates the full code representation of a component, including
8
+ * the root component code and recursively pulling in child components and also replacing
9
+ * the placeholders for those child components in the parent component's code with the
10
+ * actual code for those child components (which were generated after the parent component was generated).
11
+ *
12
+ * @param spec - The ComponentRootSpec defining the component structure and behavior
13
+ * @returns A string containing the complete executable JavaScript code for the component
14
+ */
15
+ function BuildComponentCompleteCode(spec) {
16
+ // Start with the base code for the root component
17
+ let code = spec.componentCode || '// Generation Error: No root component code provided! \n\n';
18
+ // Recursively replace placeholders for child components with their generated code
19
+ if (!spec.childComponents || spec.childComponents.length === 0) {
20
+ // If there are no child components, return the base code for this component
21
+ return code;
22
+ }
23
+ for (const child of spec.childComponents) {
24
+ const childCode = BuildComponentChildCode(child, "");
25
+ if (childCode && childCode.length > 0) {
26
+ // Append the generated code for this child component to the root component code
27
+ code += '\n\n' + childCode;
28
+ }
29
+ }
30
+ // Return the complete code for this component
31
+ return code;
32
+ }
33
+ exports.BuildComponentCompleteCode = BuildComponentCompleteCode;
34
+ /**
35
+ * Builds the code for a component child based on the provided spec including recursive child components.
36
+ * @param spec - The ComponentChildSpec defining the child component structure and behavior
37
+ * @returns A string containing the executable JavaScript code for the component child
38
+ */
39
+ function BuildComponentChildCode(child, path) {
40
+ // Start with the base code for the child component
41
+ let commentHeader = `/*******************************************************\n ${path ? `${path} > ` : ''}${child.componentName}\n ${child.description}\n*******************************************************/\n`;
42
+ let code = commentHeader + child.componentCode;
43
+ // Recursively replace placeholders for child components with their generated code
44
+ if (!child.components || child.components.length === 0) {
45
+ // If there are no child components, return the base code for this child
46
+ return code;
47
+ }
48
+ for (const sub of child.components) {
49
+ const subCode = BuildComponentChildCode(sub, path + (path ? ' > ' : '') + child.componentName);
50
+ if (subCode && subCode.length > 0) {
51
+ code += '\n\n' + subCode;
52
+ }
53
+ }
54
+ // Return the complete code for this child component
55
+ return code;
56
+ }
57
+ exports.BuildComponentChildCode = BuildComponentChildCode;
58
+ //# sourceMappingURL=util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";;;AAGA;;;;;;;;;;GAUG;AACH,SAAgB,0BAA0B,CAAC,IAAuB;IAC9D,kDAAkD;IAClD,IAAI,IAAI,GAAG,IAAI,CAAC,aAAa,IAAI,4DAA4D,CAAC;IAC9F,kFAAkF;IAClF,IAAI,CAAC,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7D,4EAA4E;QAC5E,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;QACvC,MAAM,SAAS,GAAG,uBAAuB,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACrD,IAAI,SAAS,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACpC,gFAAgF;YAChF,IAAI,IAAI,MAAM,GAAG,SAAS,CAAC;QAC/B,CAAC;IACL,CAAC;IACD,8CAA8C;IAC9C,OAAO,IAAI,CAAC;AAChB,CAAC;AAjBD,gEAiBC;AAED;;;;GAIG;AACH,SAAgB,uBAAuB,CAAC,KAAyB,EAAE,IAAY;IAC3E,mDAAmD;IACnD,IAAI,aAAa,GAAG,gEAAgE,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,aAAa,QAAQ,KAAK,CAAC,WAAW,8DAA8D,CAAA;IACzN,IAAI,IAAI,GAAG,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC;IAC/C,kFAAkF;IAClF,IAAI,CAAC,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrD,wEAAwE;QACxE,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,KAAK,MAAM,GAAG,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC;QACjC,MAAM,OAAO,GAAG,uBAAuB,CAAC,GAAG,EAAE,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC;QAC/F,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAChC,IAAI,IAAI,MAAM,GAAG,OAAO,CAAC;QAC7B,CAAC;IACL,CAAC;IACD,oDAAoD;IACpD,OAAO,IAAI,CAAC;AAChB,CAAC;AAlBD,0DAkBC"}
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@memberjunction/interactive-component-types",
3
+ "version": "2.71.0",
4
+ "description": "MemberJunction: Interactive Component - Type specifications for MJ Interactive UI Componentry",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "/dist"
9
+ ],
10
+ "scripts": {
11
+ "start": "ts-node-dev src/index.ts",
12
+ "build": "tsc",
13
+ "test": "echo \"Error: no test specified\" && exit 1"
14
+ },
15
+ "author": "MemberJunction.com",
16
+ "license": "ISC",
17
+ "devDependencies": {
18
+ "ts-node-dev": "^2.0.0",
19
+ "typescript": "^5.4.5"
20
+ },
21
+ "dependencies": {
22
+ "@memberjunction/core": "2.71.0",
23
+ "@memberjunction/data-context": "2.71.0"
24
+ }
25
+ }