@rippling/rippling-sdk 0.2.0-alpha.59 → 0.2.0-alpha.61
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/examples/manifest/dental-practice-management/dental-practice-management.ts +10 -10
- package/examples/manifest/dental-practice-management/functions/chair-schedule.ts +7 -10
- package/examples/manifest/dental-practice-management/functions/operatory-list.ts +7 -10
- package/examples/manifest/dental-practice-management/functions/patient-list.ts +7 -10
- package/examples/manifest/dental-practice-management/functions/treatment-plan-list.ts +7 -10
- package/examples/manifest/gym-membership-management/functions/check-in-desk.ts +7 -10
- package/examples/manifest/gym-membership-management/functions/member-list.ts +7 -10
- package/examples/manifest/gym-membership-management/functions/today-schedule.ts +7 -10
- package/examples/manifest/gym-membership-management/functions/trainer-list.ts +7 -10
- package/examples/manifest/gym-membership-management/gym-membership-management.ts +10 -10
- package/examples/manifest/simple-todo-app/functions/todo-list.ts +7 -10
- package/examples/manifest/simple-todo-app/simple-todo-app.ts +3 -5
- package/internal/tslib.js +0 -4
- package/lib/manifest/index.d.mts +1 -1
- package/lib/manifest/index.d.mts.map +1 -1
- package/lib/manifest/index.d.ts +1 -1
- package/lib/manifest/index.d.ts.map +1 -1
- package/lib/manifest/index.js.map +1 -1
- package/lib/manifest/index.mjs.map +1 -1
- package/lib/manifest/manifest-function.d.mts +10 -7
- package/lib/manifest/manifest-function.d.mts.map +1 -1
- package/lib/manifest/manifest-function.d.ts +10 -7
- package/lib/manifest/manifest-function.d.ts.map +1 -1
- package/lib/manifest/manifest-function.js +14 -10
- package/lib/manifest/manifest-function.js.map +1 -1
- package/lib/manifest/manifest-function.mjs +13 -10
- package/lib/manifest/manifest-function.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/manifest/index.ts +1 -0
- package/src/lib/manifest/manifest-function.ts +21 -11
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/examples/sdui/sdui-crud-todo/rippling-function.ts +0 -358
- package/examples/sdui/sdui-showcase/rippling-function.ts +0 -366
- package/examples/sdui/sdui-tab-multi-view/rippling-function.ts +0 -1042
- package/examples/sdui/vote/rippling-function.ts +0 -315
- package/lib/sdui/actions.d.mts +0 -25
- package/lib/sdui/actions.d.mts.map +0 -1
- package/lib/sdui/actions.d.ts +0 -25
- package/lib/sdui/actions.d.ts.map +0 -1
- package/lib/sdui/actions.js +0 -63
- package/lib/sdui/actions.js.map +0 -1
- package/lib/sdui/actions.mjs +0 -52
- package/lib/sdui/actions.mjs.map +0 -1
- package/lib/sdui/component.d.mts +0 -58
- package/lib/sdui/component.d.mts.map +0 -1
- package/lib/sdui/component.d.ts +0 -58
- package/lib/sdui/component.d.ts.map +0 -1
- package/lib/sdui/component.js +0 -128
- package/lib/sdui/component.js.map +0 -1
- package/lib/sdui/component.mjs +0 -124
- package/lib/sdui/component.mjs.map +0 -1
- package/lib/sdui/components.d.mts +0 -1047
- package/lib/sdui/components.d.mts.map +0 -1
- package/lib/sdui/components.d.ts +0 -1047
- package/lib/sdui/components.d.ts.map +0 -1
- package/lib/sdui/components.js +0 -845
- package/lib/sdui/components.js.map +0 -1
- package/lib/sdui/components.mjs +0 -840
- package/lib/sdui/components.mjs.map +0 -1
- package/lib/sdui/conditions.d.mts +0 -25
- package/lib/sdui/conditions.d.mts.map +0 -1
- package/lib/sdui/conditions.d.ts +0 -25
- package/lib/sdui/conditions.d.ts.map +0 -1
- package/lib/sdui/conditions.js +0 -47
- package/lib/sdui/conditions.js.map +0 -1
- package/lib/sdui/conditions.mjs +0 -35
- package/lib/sdui/conditions.mjs.map +0 -1
- package/lib/sdui/directives.d.mts +0 -18
- package/lib/sdui/directives.d.mts.map +0 -1
- package/lib/sdui/directives.d.ts +0 -18
- package/lib/sdui/directives.d.ts.map +0 -1
- package/lib/sdui/directives.js +0 -31
- package/lib/sdui/directives.js.map +0 -1
- package/lib/sdui/directives.mjs +0 -24
- package/lib/sdui/directives.mjs.map +0 -1
- package/lib/sdui/index.d.mts +0 -375
- package/lib/sdui/index.d.mts.map +0 -1
- package/lib/sdui/index.d.ts +0 -375
- package/lib/sdui/index.d.ts.map +0 -1
- package/lib/sdui/index.js +0 -386
- package/lib/sdui/index.js.map +0 -1
- package/lib/sdui/index.mjs +0 -215
- package/lib/sdui/index.mjs.map +0 -1
- package/lib/sdui/propTypes.d.mts +0 -5971
- package/lib/sdui/propTypes.d.mts.map +0 -1
- package/lib/sdui/propTypes.d.ts +0 -5971
- package/lib/sdui/propTypes.d.ts.map +0 -1
- package/lib/sdui/propTypes.js +0 -14
- package/lib/sdui/propTypes.js.map +0 -1
- package/lib/sdui/propTypes.mjs +0 -13
- package/lib/sdui/propTypes.mjs.map +0 -1
- package/lib/sdui/props.d.mts +0 -12
- package/lib/sdui/props.d.mts.map +0 -1
- package/lib/sdui/props.d.ts +0 -12
- package/lib/sdui/props.d.ts.map +0 -1
- package/lib/sdui/props.js +0 -25
- package/lib/sdui/props.js.map +0 -1
- package/lib/sdui/props.mjs +0 -21
- package/lib/sdui/props.mjs.map +0 -1
- package/lib/sdui/render.d.mts +0 -23
- package/lib/sdui/render.d.mts.map +0 -1
- package/lib/sdui/render.d.ts +0 -23
- package/lib/sdui/render.d.ts.map +0 -1
- package/lib/sdui/render.js +0 -48
- package/lib/sdui/render.js.map +0 -1
- package/lib/sdui/render.mjs +0 -45
- package/lib/sdui/render.mjs.map +0 -1
- package/lib/sdui/state.d.mts +0 -22
- package/lib/sdui/state.d.mts.map +0 -1
- package/lib/sdui/state.d.ts +0 -22
- package/lib/sdui/state.d.ts.map +0 -1
- package/lib/sdui/state.js +0 -59
- package/lib/sdui/state.js.map +0 -1
- package/lib/sdui/state.mjs +0 -55
- package/lib/sdui/state.mjs.map +0 -1
- package/lib/sdui.d.mts +0 -3
- package/lib/sdui.d.mts.map +0 -1
- package/lib/sdui.d.ts +0 -3
- package/lib/sdui.d.ts.map +0 -1
- package/lib/sdui.js +0 -8
- package/lib/sdui.js.map +0 -1
- package/lib/sdui.mjs +0 -3
- package/lib/sdui.mjs.map +0 -1
- package/src/lib/sdui/actions.ts +0 -71
- package/src/lib/sdui/component.ts +0 -162
- package/src/lib/sdui/components.ts +0 -1572
- package/src/lib/sdui/conditions.ts +0 -59
- package/src/lib/sdui/directives.ts +0 -45
- package/src/lib/sdui/index.ts +0 -650
- package/src/lib/sdui/propTypes.ts +0 -8087
- package/src/lib/sdui/props.ts +0 -32
- package/src/lib/sdui/render.ts +0 -66
- package/src/lib/sdui/state.ts +0 -66
- package/src/lib/sdui.ts +0 -2
package/src/lib/sdui/props.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { VisibilityCondition } from './conditions';
|
|
2
|
-
import { extractPath } from './state';
|
|
3
|
-
|
|
4
|
-
export interface CondRef {
|
|
5
|
-
$cond: VisibilityCondition;
|
|
6
|
-
$then: unknown;
|
|
7
|
-
$else: unknown;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface TemplateRef {
|
|
11
|
-
$template: string;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function cond(condition: VisibilityCondition, thenValue: unknown, elseValue: unknown): CondRef {
|
|
15
|
-
return { $cond: condition, $then: thenValue, $else: elseValue };
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function template(strings: TemplateStringsArray, ...values: unknown[]): TemplateRef {
|
|
19
|
-
let result = '';
|
|
20
|
-
for (let i = 0; i < strings.length; i++) {
|
|
21
|
-
result += strings[i];
|
|
22
|
-
if (i < values.length) {
|
|
23
|
-
try {
|
|
24
|
-
const path = extractPath(values[i]);
|
|
25
|
-
result += `\${${path}}`;
|
|
26
|
-
} catch {
|
|
27
|
-
result += String(values[i]);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return { $template: result };
|
|
32
|
-
}
|
package/src/lib/sdui/render.ts
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import type { ActionBinding } from './actions';
|
|
2
|
-
import type { SpecNode } from './components';
|
|
3
|
-
|
|
4
|
-
export interface FlatElement {
|
|
5
|
-
type: string;
|
|
6
|
-
props: Record<string, unknown>;
|
|
7
|
-
children: string[];
|
|
8
|
-
on?: Record<string, ActionBinding | ActionBinding[]>;
|
|
9
|
-
visible?: unknown;
|
|
10
|
-
watch?: Record<string, unknown>;
|
|
11
|
-
repeat?: { statePath: string; key?: string };
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface Spec {
|
|
15
|
-
root: string;
|
|
16
|
-
elements: Record<string, FlatElement>;
|
|
17
|
-
state: Record<string, unknown>;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export function render(stateProxy: { $initialValues: Record<string, unknown> }, rootElement: SpecNode): Spec {
|
|
21
|
-
const elements: Record<string, FlatElement> = {};
|
|
22
|
-
const localStates: { path: string; initial: unknown }[] = [];
|
|
23
|
-
let counter = 0;
|
|
24
|
-
|
|
25
|
-
function flattenNode(node: SpecNode | null | undefined): string | null {
|
|
26
|
-
if (!node) return null;
|
|
27
|
-
|
|
28
|
-
// Collect local state registrations from component() wrappers
|
|
29
|
-
const registration = (node as any)._localStateRegistration;
|
|
30
|
-
if (registration) {
|
|
31
|
-
localStates.push(registration);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
counter += 1;
|
|
35
|
-
const id = `${node.type.toLowerCase()}_${counter}`;
|
|
36
|
-
const childIds = node.children.map(flattenNode).filter((childId): childId is string => childId !== null);
|
|
37
|
-
|
|
38
|
-
const element: FlatElement = {
|
|
39
|
-
type: node.type,
|
|
40
|
-
props: node.props,
|
|
41
|
-
children: childIds,
|
|
42
|
-
};
|
|
43
|
-
if (node.visible !== undefined) element.visible = node.visible;
|
|
44
|
-
if (node.on) element.on = node.on;
|
|
45
|
-
if (node.watch) element.watch = node.watch;
|
|
46
|
-
if (node.repeat) element.repeat = node.repeat;
|
|
47
|
-
|
|
48
|
-
elements[id] = element;
|
|
49
|
-
return id;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const rootId = flattenNode(rootElement);
|
|
53
|
-
if (rootId === null) {
|
|
54
|
-
throw new Error('render(): root element produced no id');
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// Merge global state + local states from component() calls
|
|
58
|
-
const state: Record<string, unknown> = { ...stateProxy.$initialValues };
|
|
59
|
-
for (const { path, initial } of localStates) {
|
|
60
|
-
// path is like "/auto_xxx" — strip leading / for state key
|
|
61
|
-
const key = path.startsWith('/') ? path.slice(1) : path;
|
|
62
|
-
state[key] = initial;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return { root: rootId, elements, state };
|
|
66
|
-
}
|
package/src/lib/sdui/state.ts
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
// State proxy — creates deeply nested proxies that produce $state refs on access
|
|
2
|
-
|
|
3
|
-
export type StateRef = { $state: string };
|
|
4
|
-
export type BindStateRef = { $bindState: string };
|
|
5
|
-
|
|
6
|
-
// Deep proxy type — every property access returns another proxy (for s.teamData.team.name)
|
|
7
|
-
// This allows deep access regardless of the initial value (even null)
|
|
8
|
-
type DeepStateProxy = {
|
|
9
|
-
readonly [key: string]: DeepStateProxy;
|
|
10
|
-
} & {
|
|
11
|
-
readonly $state: string;
|
|
12
|
-
readonly $bind: BindStateRef;
|
|
13
|
-
readonly $path: string;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export type StateProxy<T> = {
|
|
17
|
-
[K in keyof T]: T[K] extends Record<string, unknown> ? StateProxy<T[K]> & DeepStateProxy : DeepStateProxy;
|
|
18
|
-
} & DeepStateProxy & { readonly $initialValues: T };
|
|
19
|
-
|
|
20
|
-
const PROXY_MARKER = Symbol('stateProxy');
|
|
21
|
-
const INITIAL_VALUES = Symbol('initialValues');
|
|
22
|
-
|
|
23
|
-
function isStateProxy(value: unknown): boolean {
|
|
24
|
-
return typeof value === 'object' && value !== null && (value as any)[PROXY_MARKER] === true;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export function extractPath(ref: unknown): string {
|
|
28
|
-
if (isStateProxy(ref)) return (ref as any).$path;
|
|
29
|
-
if (typeof ref === 'object' && ref !== null && '$state' in ref) return (ref as any).$state;
|
|
30
|
-
// Support scope proxies from component() — they have $path as a getter
|
|
31
|
-
if (typeof ref === 'object' && ref !== null) {
|
|
32
|
-
try {
|
|
33
|
-
const p = (ref as any).$path;
|
|
34
|
-
if (typeof p === 'string') return p;
|
|
35
|
-
} catch {
|
|
36
|
-
// proxy access threw; fall through to the error below
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
throw new Error('Expected a state proxy or { $state } ref');
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function createProxy<T>(path: string, initialValues: T): StateProxy<T> {
|
|
43
|
-
const handler: ProxyHandler<object> = {
|
|
44
|
-
get(_target, prop) {
|
|
45
|
-
if (prop === PROXY_MARKER) return true;
|
|
46
|
-
if (prop === INITIAL_VALUES) return initialValues;
|
|
47
|
-
if (prop === '$initialValues') return initialValues;
|
|
48
|
-
if (prop === '$state') return path;
|
|
49
|
-
if (prop === '$bind') return { $bindState: path };
|
|
50
|
-
if (prop === '$path') return path;
|
|
51
|
-
// Support JSON serialization — toJSON returns { $state: path }
|
|
52
|
-
if (prop === 'toJSON') return () => ({ $state: path });
|
|
53
|
-
// For equality checks
|
|
54
|
-
if (prop === Symbol.toPrimitive) return () => `$state:${path}`;
|
|
55
|
-
|
|
56
|
-
const childPath = `${path}/${String(prop)}`;
|
|
57
|
-
return createProxy(childPath, undefined as any);
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
return new Proxy({} as any, handler);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export function createState<T extends Record<string, unknown>>(shape: T): StateProxy<T> {
|
|
65
|
-
return createProxy('', shape);
|
|
66
|
-
}
|
package/src/lib/sdui.ts
DELETED