ballerina-core 1.0.187 → 1.0.188

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "ballerina-core",
3
3
  "author": "Dr. Giuseppe Maggiore",
4
4
  "private": false,
5
- "version": "1.0.187",
5
+ "version": "1.0.188",
6
6
  "main": "main.ts",
7
7
  "scripts": {
8
8
  "prettier": "prettier --write ."
@@ -42,7 +42,7 @@ export const ReadOnlyAbstractRenderer = <
42
42
  CommonAbstractRendererForeignMutationsExpected<Flags>
43
43
  >,
44
44
  IdProvider: (props: IdWrapperProps) => React.ReactNode,
45
- _ErrorRenderer: (props: ErrorRendererProps) => React.ReactNode,
45
+ ErrorRenderer: (props: ErrorRendererProps) => React.ReactNode,
46
46
  ) => {
47
47
  const configuredChildTemplate = embeddedTemplate
48
48
  .mapContext(
@@ -99,14 +99,29 @@ export const ReadOnlyAbstractRenderer = <
99
99
  CommonAbstractRendererForeignMutationsExpected<Flags>,
100
100
  ReadOnlyAbstractRendererView<CustomPresentationContext, Flags, ExtraContext>
101
101
  >((props) => {
102
+ const domNodeId = props.context.domNodeAncestorPath + "[readOnly]";
103
+ if (!PredicateValue.Operations.IsReadOnly(props.context.value)) {
104
+ console.error(
105
+ `ReadOnly value expected but got: ${JSON.stringify(
106
+ props.context.value,
107
+ )}\n...When rendering \n...${domNodeId}`,
108
+ );
109
+ return (
110
+ <ErrorRenderer
111
+ message={`${domNodeId}: ReadOnly value expected for list but got ${JSON.stringify(
112
+ props.context.value,
113
+ )}`}
114
+ />
115
+ );
116
+ }
102
117
  return (
103
118
  <>
104
- <IdProvider domNodeId={props.context.domNodeAncestorPath}>
119
+ <IdProvider domNodeId={domNodeId}>
105
120
  <props.view
106
121
  {...props}
107
122
  context={{
108
123
  ...props.context,
109
- domNodeId: props.context.domNodeAncestorPath,
124
+ domNodeId,
110
125
  }}
111
126
  embeddedTemplate={configuredChildTemplate}
112
127
  />