@almadar/std 3.7.0 → 3.9.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.
@@ -85,6 +85,10 @@
85
85
  "name": "id",
86
86
  "type": "string",
87
87
  "required": true
88
+ },
89
+ {
90
+ "name": "row",
91
+ "type": "object"
88
92
  }
89
93
  ]
90
94
  },
@@ -96,6 +100,10 @@
96
100
  "name": "id",
97
101
  "type": "string",
98
102
  "required": true
103
+ },
104
+ {
105
+ "name": "row",
106
+ "type": "object"
99
107
  }
100
108
  ]
101
109
  },
@@ -107,6 +115,10 @@
107
115
  "name": "id",
108
116
  "type": "string",
109
117
  "required": true
118
+ },
119
+ {
120
+ "name": "row",
121
+ "type": "object"
110
122
  }
111
123
  ]
112
124
  },
@@ -360,7 +372,12 @@
360
372
  },
361
373
  {
362
374
  "type": "typography",
363
- "content": "Are you sure you want to delete this product?",
375
+ "content": "@entity.name",
376
+ "variant": "h4"
377
+ },
378
+ {
379
+ "type": "typography",
380
+ "content": "This action cannot be undone.",
364
381
  "variant": "body"
365
382
  },
366
383
  {
@@ -2875,123 +2892,116 @@
2875
2892
  "type": "divider"
2876
2893
  },
2877
2894
  {
2878
- "type": "data-list",
2895
+ "type": "stack",
2896
+ "direction": "vertical",
2897
+ "gap": "sm",
2879
2898
  "entity": "Checkout",
2880
- "renderItem": [
2881
- "fn",
2882
- "item",
2899
+ "children": [
2883
2900
  {
2884
2901
  "type": "stack",
2885
- "direction": "vertical",
2886
- "gap": "sm",
2902
+ "direction": "horizontal",
2903
+ "gap": "md",
2904
+ "justify": "space-between",
2887
2905
  "children": [
2888
2906
  {
2889
- "type": "stack",
2890
- "direction": "horizontal",
2891
- "gap": "md",
2892
- "justify": "space-between",
2893
- "children": [
2894
- {
2895
- "type": "typography",
2896
- "variant": "caption",
2897
- "content": "CustomerName"
2898
- },
2899
- {
2900
- "type": "typography",
2901
- "variant": "body",
2902
- "content": "@item.customerName"
2903
- }
2904
- ]
2907
+ "type": "typography",
2908
+ "variant": "caption",
2909
+ "content": "Customer Name"
2905
2910
  },
2906
2911
  {
2907
- "type": "stack",
2908
- "direction": "horizontal",
2909
- "gap": "md",
2910
- "justify": "space-between",
2911
- "children": [
2912
- {
2913
- "type": "typography",
2914
- "variant": "caption",
2915
- "content": "Email"
2916
- },
2917
- {
2918
- "type": "typography",
2919
- "variant": "body",
2920
- "content": "@item.email"
2921
- }
2922
- ]
2912
+ "type": "typography",
2913
+ "variant": "body",
2914
+ "content": "@entity.customerName"
2915
+ }
2916
+ ]
2917
+ },
2918
+ {
2919
+ "type": "stack",
2920
+ "direction": "horizontal",
2921
+ "gap": "md",
2922
+ "justify": "space-between",
2923
+ "children": [
2924
+ {
2925
+ "type": "typography",
2926
+ "variant": "caption",
2927
+ "content": "Email"
2923
2928
  },
2924
2929
  {
2925
- "type": "stack",
2926
- "direction": "horizontal",
2927
- "gap": "md",
2928
- "justify": "space-between",
2929
- "children": [
2930
- {
2931
- "type": "typography",
2932
- "variant": "caption",
2933
- "content": "ShippingAddress"
2934
- },
2935
- {
2936
- "type": "typography",
2937
- "variant": "body",
2938
- "content": "@item.shippingAddress"
2939
- }
2940
- ]
2930
+ "type": "typography",
2931
+ "variant": "body",
2932
+ "content": "@entity.email"
2933
+ }
2934
+ ]
2935
+ },
2936
+ {
2937
+ "type": "stack",
2938
+ "direction": "horizontal",
2939
+ "gap": "md",
2940
+ "justify": "space-between",
2941
+ "children": [
2942
+ {
2943
+ "type": "typography",
2944
+ "variant": "caption",
2945
+ "content": "Shipping Address"
2941
2946
  },
2942
2947
  {
2943
- "type": "stack",
2944
- "direction": "horizontal",
2945
- "gap": "md",
2946
- "justify": "space-between",
2947
- "children": [
2948
- {
2949
- "type": "typography",
2950
- "variant": "caption",
2951
- "content": "PaymentMethod"
2952
- },
2953
- {
2954
- "type": "typography",
2955
- "variant": "body",
2956
- "content": "@item.paymentMethod"
2957
- }
2958
- ]
2948
+ "type": "typography",
2949
+ "variant": "body",
2950
+ "content": "@entity.shippingAddress"
2951
+ }
2952
+ ]
2953
+ },
2954
+ {
2955
+ "type": "stack",
2956
+ "direction": "horizontal",
2957
+ "gap": "md",
2958
+ "justify": "space-between",
2959
+ "children": [
2960
+ {
2961
+ "type": "typography",
2962
+ "variant": "caption",
2963
+ "content": "Payment Method"
2959
2964
  },
2960
2965
  {
2961
- "type": "stack",
2962
- "direction": "horizontal",
2963
- "gap": "md",
2964
- "justify": "space-between",
2965
- "children": [
2966
- {
2967
- "type": "typography",
2968
- "variant": "caption",
2969
- "content": "OrderTotal"
2970
- },
2971
- {
2972
- "type": "typography",
2973
- "variant": "body",
2974
- "content": "@item.orderTotal"
2975
- }
2976
- ]
2966
+ "type": "typography",
2967
+ "variant": "body",
2968
+ "content": "@entity.paymentMethod"
2969
+ }
2970
+ ]
2971
+ },
2972
+ {
2973
+ "type": "stack",
2974
+ "direction": "horizontal",
2975
+ "gap": "md",
2976
+ "justify": "space-between",
2977
+ "children": [
2978
+ {
2979
+ "type": "typography",
2980
+ "variant": "caption",
2981
+ "content": "Order Total"
2977
2982
  },
2978
2983
  {
2979
- "type": "stack",
2980
- "direction": "horizontal",
2981
- "gap": "md",
2982
- "justify": "space-between",
2983
- "children": [
2984
- {
2985
- "type": "typography",
2986
- "variant": "caption",
2987
- "content": "Status"
2988
- },
2989
- {
2990
- "type": "typography",
2991
- "variant": "body",
2992
- "content": "@item.status"
2993
- }
2994
- ]
2984
+ "type": "typography",
2985
+ "variant": "body",
2986
+ "content": "@entity.orderTotal"
2987
+ }
2988
+ ]
2989
+ },
2990
+ {
2991
+ "type": "stack",
2992
+ "direction": "horizontal",
2993
+ "gap": "md",
2994
+ "justify": "space-between",
2995
+ "children": [
2996
+ {
2997
+ "type": "typography",
2998
+ "variant": "caption",
2999
+ "content": "Status"
3000
+ },
3001
+ {
3002
+ "type": "typography",
3003
+ "variant": "body",
3004
+ "content": "@entity.status"
2995
3005
  }
2996
3006
  ]
2997
3007
  }
@@ -3852,6 +3862,10 @@
3852
3862
  "name": "id",
3853
3863
  "type": "string",
3854
3864
  "required": true
3865
+ },
3866
+ {
3867
+ "name": "row",
3868
+ "type": "object"
3855
3869
  }
3856
3870
  ]
3857
3871
  },
@@ -3863,6 +3877,10 @@
3863
3877
  "name": "id",
3864
3878
  "type": "string",
3865
3879
  "required": true
3880
+ },
3881
+ {
3882
+ "name": "row",
3883
+ "type": "object"
3866
3884
  }
3867
3885
  ]
3868
3886
  },
@@ -3874,6 +3892,10 @@
3874
3892
  "name": "id",
3875
3893
  "type": "string",
3876
3894
  "required": true
3895
+ },
3896
+ {
3897
+ "name": "row",
3898
+ "type": "object"
3877
3899
  }
3878
3900
  ]
3879
3901
  },
@@ -4128,7 +4150,12 @@
4128
4150
  },
4129
4151
  {
4130
4152
  "type": "typography",
4131
- "content": "Are you sure you want to delete this orderrecord?",
4153
+ "content": "@entity.customerName",
4154
+ "variant": "h4"
4155
+ },
4156
+ {
4157
+ "type": "typography",
4158
+ "content": "This action cannot be undone.",
4132
4159
  "variant": "body"
4133
4160
  },
4134
4161
  {
@@ -1,11 +1,11 @@
1
1
  [
2
2
  {
3
- "name": "std-timer",
3
+ "name": "std-ecommerce",
4
4
  "errors": 0,
5
5
  "warnings": 0,
6
6
  "output": [
7
7
  "Loaded 22 services from packages/almadar-patterns/src/services-registry.json",
8
- "Validating schema: /home/osamah/kflow.ai.builder/packages/almadar-std/behaviors/exports/atoms/std-timer.orb"
8
+ "Validating schema: /home/osamah/kflow.ai.builder/packages/almadar-std/behaviors/exports/organisms/std-ecommerce.orb"
9
9
  ]
10
10
  }
11
11
  ]
package/dist/index.js CHANGED
@@ -3940,7 +3940,7 @@ function buildTrait(c) {
3940
3940
  if (isRefresh) {
3941
3941
  return { key: e, name: e, payload: [{ name: "data", type: "object", required: true }] };
3942
3942
  }
3943
- return needsId ? { key: e, name: e, payload: [{ name: "id", type: "string", required: true }] } : { key: e, name: e };
3943
+ return needsId ? { key: e, name: e, payload: [{ name: "id", type: "string", required: true }, { name: "row", type: "object" }] } : { key: e, name: e };
3944
3944
  })
3945
3945
  ];
3946
3946
  const listensDecl = c.refreshEvents.length > 0 ? c.refreshEvents.map((evt) => ({ event: evt, triggers: evt })) : void 0;
@@ -6704,14 +6704,14 @@ function buildStepUI(c, stepIndex) {
6704
6704
  };
6705
6705
  }
6706
6706
  function buildReviewUI(c) {
6707
- const reviewDetailChildren = c.nonIdFields.map((field) => ({
6707
+ const reviewRows = c.nonIdFields.map((field) => ({
6708
6708
  type: "stack",
6709
6709
  direction: "horizontal",
6710
6710
  gap: "md",
6711
6711
  justify: "space-between",
6712
6712
  children: [
6713
- { type: "typography", variant: "caption", content: field.name.charAt(0).toUpperCase() + field.name.slice(1) },
6714
- { type: "typography", variant: "body", content: `@item.${field.name}` }
6713
+ { type: "typography", variant: "caption", content: field.name.charAt(0).toUpperCase() + field.name.slice(1).replace(/([A-Z])/g, " $1") },
6714
+ { type: "typography", variant: "body", content: `@entity.${field.name}` }
6715
6715
  ]
6716
6716
  }));
6717
6717
  return {
@@ -6733,14 +6733,11 @@ function buildReviewUI(c) {
6733
6733
  { type: "wizard-progress", steps: c.wizardProgressSteps, currentStep: c.totalSteps },
6734
6734
  { type: "divider" },
6735
6735
  {
6736
- type: "data-list",
6736
+ type: "stack",
6737
+ direction: "vertical",
6738
+ gap: "sm",
6737
6739
  entity: c.entityName,
6738
- renderItem: ["fn", "item", {
6739
- type: "stack",
6740
- direction: "vertical",
6741
- gap: "sm",
6742
- children: reviewDetailChildren
6743
- }]
6740
+ children: reviewRows
6744
6741
  },
6745
6742
  {
6746
6743
  type: "wizard-navigation",
@@ -12087,7 +12084,7 @@ function resolve52(params) {
12087
12084
  createButtonLabel: params.createButtonLabel ?? `Create ${entityName}`,
12088
12085
  createFormTitle: params.createFormTitle ?? `Create ${entityName}`,
12089
12086
  editFormTitle: params.editFormTitle ?? `Edit ${entityName}`,
12090
- deleteMessage: params.deleteMessage ?? `Are you sure you want to delete this ${entityName.toLowerCase()}?`,
12087
+ deleteMessage: params.deleteMessage ?? `This action cannot be undone.`,
12091
12088
  emptyTitle: params.emptyTitle ?? `No ${p.toLowerCase()} yet`,
12092
12089
  emptyDescription: params.emptyDescription ?? `Create your first ${entityName.toLowerCase()} to get started.`,
12093
12090
  headerIcon: params.headerIcon ?? "list",
@@ -12239,6 +12236,10 @@ function stdList(params) {
12239
12236
  }));
12240
12237
  const sm = browseTrait.stateMachine;
12241
12238
  sm.states.push({ name: "deleting" });
12239
+ const deleteEvent = sm.events.find((e) => e.key === "DELETE");
12240
+ if (deleteEvent && !deleteEvent.payload) {
12241
+ deleteEvent.payload = [{ name: "id", type: "string" }, { name: "row", type: "object" }];
12242
+ }
12242
12243
  const existingKeys = new Set(sm.events.map((e) => e.key));
12243
12244
  if (!existingKeys.has("CONFIRM_DELETE")) sm.events.push({ key: "CONFIRM_DELETE", name: "Confirm Delete" });
12244
12245
  if (!existingKeys.has("CANCEL")) sm.events.push({ key: "CANCEL", name: "Cancel" });
@@ -12262,6 +12263,7 @@ function stdList(params) {
12262
12263
  { type: "typography", content: `Delete ${entityName}`, variant: "h3" }
12263
12264
  ] },
12264
12265
  { type: "divider" },
12266
+ { type: "typography", content: `@entity.${c.nonIdFields[0]?.name ?? "name"}`, variant: "h4" },
12265
12267
  { type: "typography", content: c.deleteMessage, variant: "body" },
12266
12268
  { type: "stack", direction: "horizontal", gap: "sm", justify: "end", children: [
12267
12269
  { type: "button", label: "Cancel", event: "CANCEL", variant: "ghost" },