oolib 2.227.9 → 2.227.10

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.
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.genLinkOrText = void 0;
4
+ var ootils_1 = require("@okf/ootils");
4
5
  var genLinkOrText = function (value, cb, options) {
5
6
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
6
7
  if (cb === void 0) { cb = undefined; }
7
8
  if (options === void 0) { options = {}; }
9
+ var SELF_MANAGED_BASE_CONFIGS = options.SELF_MANAGED_BASE_CONFIGS;
8
10
  if ((!value.data ||
9
11
  !value.data._id ||
10
12
  (!((_a = value.data.meta) === null || _a === void 0 ? void 0 : _a.content_type) &&
@@ -18,9 +20,13 @@ var genLinkOrText = function (value, cb, options) {
18
20
  // create links for content types
19
21
  if ((_e = (_d = value.data) === null || _d === void 0 ? void 0 : _d.meta) === null || _e === void 0 ? void 0 : _e.content_type) {
20
22
  var _k = value.data, content_type = _k.meta.content_type, _id = _k._id;
21
- link = "/published-page/".concat(content_type, "?id=").concat(_id);
23
+ link = (0, ootils_1.getRoutePathToPublishedContent)({
24
+ contentType: content_type,
25
+ contentId: _id,
26
+ SELF_MANAGED_BASE_CONFIGS: SELF_MANAGED_BASE_CONFIGS,
27
+ });
22
28
  }
23
- // create links for profiles
29
+ // create links for profiles
24
30
  else if (((_g = (_f = value.data) === null || _f === void 0 ? void 0 : _f.meta) === null || _g === void 0 ? void 0 : _g.profile_type) || ((_h = value.data) === null || _h === void 0 ? void 0 : _h.profileType)) {
25
31
  var profileType = ((_j = value.data.meta) === null || _j === void 0 ? void 0 : _j.profile_type) || value.data.profileType;
26
32
  var _l = value.data, user = _l.user, _id = _l._id;
@@ -40,7 +46,11 @@ var genLinkOrText = function (value, cb, options) {
40
46
  //create links for content tags
41
47
  else if (value.tagCategory === 'contentTags') {
42
48
  //i think value.tagType is redundant, but will have to check
43
- link = "/published-page/".concat(value.tagType || value.meta.kp_content_type, "?id=").concat(value._id);
49
+ link = (0, ootils_1.getRoutePathToPublishedContent)({
50
+ contentType: value.tagType || value.meta.kp_content_type,
51
+ contentId: value._id,
52
+ SELF_MANAGED_BASE_CONFIGS: SELF_MANAGED_BASE_CONFIGS,
53
+ });
44
54
  }
45
55
  return cb ? (cb(value.display, link)) : ({ link: link });
46
56
  }
@@ -8,8 +8,11 @@ var react_1 = __importDefault(require("react"));
8
8
  var genLinkOrText_1 = require("./genLinkOrText");
9
9
  var Tags_1 = require("../../Tags");
10
10
  var genTagComp = function (id, d, options) {
11
+ var _a;
11
12
  if (options === void 0) { options = {}; }
12
- var link = (0, genLinkOrText_1.genLinkOrText)(d).link;
13
+ var link = (0, genLinkOrText_1.genLinkOrText)(d, undefined, {
14
+ SELF_MANAGED_BASE_CONFIGS: (_a = options.theme) === null || _a === void 0 ? void 0 : _a.SELF_MANAGED_BASE_CONFIGS,
15
+ }).link;
13
16
  var showOptions = options.showOptions;
14
17
  switch (true) {
15
18
  case !options.display:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oolib",
3
- "version": "2.227.9",
3
+ "version": "2.227.10",
4
4
  "description": " OKE Component Library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -95,6 +95,7 @@
95
95
  "@lexical/react": "^0.13.1",
96
96
  "@lexical/table": "^0.13.1",
97
97
  "@material/material-color-utilities": "^0.3.0",
98
+ "@okf/ootils": "^1.22.0",
98
99
  "@phosphor-icons/react": "^2.1.10",
99
100
  "@react-hook/resize-observer": "^1.2.6",
100
101
  "babel-polyfill": "^6.26.0",