@dosgato/templating 0.0.15 → 0.0.16

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/dist/editbar.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export interface EditBarOpts {
2
2
  extraClass?: string;
3
3
  label?: string;
4
+ editMode?: boolean;
4
5
  }
5
6
  export declare function editBar(path: string, opts: EditBarOpts & {
6
7
  label: string;
package/dist/editbar.js CHANGED
@@ -4,6 +4,8 @@ exports.newBar = exports.editBar = void 0;
4
4
  const txstate_utils_1 = require("txstate-utils");
5
5
  function editBar(path, opts) {
6
6
  var _a;
7
+ if (!opts.editMode)
8
+ return '';
7
9
  const id = (0, txstate_utils_1.randomid)();
8
10
  return `
9
11
  <div class="dg-edit-bar ${(_a = opts.extraClass) !== null && _a !== void 0 ? _a : ''}" data-path="${(0, txstate_utils_1.htmlEncode)(path)}">
@@ -17,6 +19,8 @@ function editBar(path, opts) {
17
19
  exports.editBar = editBar;
18
20
  function newBar(path, opts) {
19
21
  var _a;
22
+ if (!opts.editMode)
23
+ return '';
20
24
  return `
21
25
  <div class="dg-new-bar ${(_a = opts.extraClass) !== null && _a !== void 0 ? _a : ''}" data-path="${(0, txstate_utils_1.htmlEncode)(path)}">
22
26
  <button>${(0, txstate_utils_1.htmlEncode)(opts.label)}</button>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dosgato/templating",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "description": "A library to support building templates for dosgato CMS.",
5
5
  "exports": {
6
6
  "require": "./dist/index.js",