@gem-sdk/system 2.0.0-dev.184 → 2.0.0-dev.215

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.
@@ -81,9 +81,13 @@ const If = (condition, trueResult, falseResult)=>{
81
81
  }
82
82
  };
83
83
  const LiquidIf = (c, t, f)=>`{% if ${c} %}${typeof t === 'string' ? t : t()}${f ? `{% else %}${typeof f === 'string' ? f : f?.()}` : ''}{% endif %}`;
84
+ const Unless = (condition, trueResult, falseResult)=>If(!condition, trueResult, falseResult);
85
+ const LiquidUnless = (c, t, f)=>`{% unless ${c} %}${typeof t === 'string' ? t : t()}${f ? `{% else %}${typeof f === 'string' ? f : f?.()}` : ''}{% endunless %}`;
84
86
 
85
87
  exports.For = For;
86
88
  exports.If = If;
87
89
  exports.Liquid = Liquid;
88
90
  exports.LiquidFor = LiquidFor;
89
91
  exports.LiquidIf = LiquidIf;
92
+ exports.LiquidUnless = LiquidUnless;
93
+ exports.Unless = Unless;
package/dist/cjs/index.js CHANGED
@@ -22,6 +22,8 @@ exports.If = template.If;
22
22
  exports.Liquid = template.Liquid;
23
23
  exports.LiquidFor = template.LiquidFor;
24
24
  exports.LiquidIf = template.LiquidIf;
25
+ exports.LiquidUnless = template.LiquidUnless;
26
+ exports.Unless = template.Unless;
25
27
  exports.createAttrReact = createAttrReact;
26
28
  exports.createClassReact = createClassReact;
27
29
  exports.createContentReact = createContentReact;
@@ -79,5 +79,7 @@ const If = (condition, trueResult, falseResult)=>{
79
79
  }
80
80
  };
81
81
  const LiquidIf = (c, t, f)=>`{% if ${c} %}${typeof t === 'string' ? t : t()}${f ? `{% else %}${typeof f === 'string' ? f : f?.()}` : ''}{% endif %}`;
82
+ const Unless = (condition, trueResult, falseResult)=>If(!condition, trueResult, falseResult);
83
+ const LiquidUnless = (c, t, f)=>`{% unless ${c} %}${typeof t === 'string' ? t : t()}${f ? `{% else %}${typeof f === 'string' ? f : f?.()}` : ''}{% endunless %}`;
82
84
 
83
- export { For, If, Liquid, LiquidFor, LiquidIf };
85
+ export { For, If, Liquid, LiquidFor, LiquidIf, LiquidUnless, Unless };
package/dist/esm/index.js CHANGED
@@ -3,7 +3,7 @@ export { createStyle, createStyleReact } from './component/createStyle.js';
3
3
  import { createContent } from './component/createContent.js';
4
4
  import { createClass } from './component/createClass.js';
5
5
  export { createStateOrContext } from './component/createStateOrContext.js';
6
- export { For, If, Liquid, LiquidFor, LiquidIf } from './component/template.js';
6
+ export { For, If, Liquid, LiquidFor, LiquidIf, LiquidUnless, Unless } from './component/template.js';
7
7
 
8
8
  const createAttrReact = createAttr;
9
9
  const createContentReact = createContent;
@@ -33,6 +33,8 @@ declare const For: <T>(items: T[], renderFn: (item: T, index: number) => JSX.Ele
33
33
  declare const LiquidFor: (c: string, t: string | CallbackCondition) => string;
34
34
  declare const If: (condition: boolean | null | undefined, trueResult: string | JSX.Element | CallbackCondition, falseResult?: string | JSX.Element | CallbackCondition) => JSX.Element | string | null;
35
35
  declare const LiquidIf: (c: string, t: string | CallbackCondition, f?: string | CallbackCondition) => string;
36
+ declare const Unless: (condition: boolean | null | undefined, trueResult: string | JSX.Element | CallbackCondition, falseResult?: string | JSX.Element | CallbackCondition) => string | JSX.Element | null;
37
+ declare const LiquidUnless: (c: string, t: string | CallbackCondition, f?: string | CallbackCondition) => string;
36
38
 
37
39
  declare const createAttrReact: (obj: {
38
40
  [key: string]: string | number;
@@ -46,4 +48,4 @@ declare const createClassReact: (obj: {
46
48
  [key: string]: boolean | undefined;
47
49
  }) => string;
48
50
 
49
- export { For, If, Liquid, LiquidFor, LiquidIf, createAttr, createAttrReact, createClass, createClassReact, createContent, createContentReact, createStateOrContext, createStyle, createStyleReact };
51
+ export { For, If, Liquid, LiquidFor, LiquidIf, LiquidUnless, Unless, createAttr, createAttrReact, createClass, createClassReact, createContent, createContentReact, createStateOrContext, createStyle, createStyleReact };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/system",
3
- "version": "2.0.0-dev.184",
3
+ "version": "2.0.0-dev.215",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "dependencies": {},
23
23
  "devDependencies": {
24
- "@gem-sdk/core": "2.0.0-dev.184"
24
+ "@gem-sdk/core": "2.0.0-dev.212"
25
25
  },
26
26
  "module": "dist/esm/index.js",
27
27
  "types": "dist/types/index.d.ts",