odant-work 1.0.67 → 1.0.68

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,17 +1,17 @@
1
1
  {
2
2
  "packageName": "odant-work",
3
- "version": "1.0.67",
3
+ "version": "1.0.68",
4
4
  "createdAt": 1795100682741,
5
- "updatedAt": 1795527375184,
5
+ "updatedAt": 1795529372525,
6
6
  "files": {
7
7
  "run.mjs": "f8918c612e8641e9beee06221be6680aa6fd21f25468451f2ac857fd51772266",
8
- "package.json": "3807820de79a5b247b916816535fc995a4d90df2981717d6c323238bdc21fcd1",
9
- "package-lock.json": "f751ec9d236ba6d9bcd84155cf00b273d49a253e4cc73f7a95905e9718f5ba74",
8
+ "package.json": "3160532b89557a81954d1ba37b12553d61f4c9f15c3f2e4844aace6fa033d82b",
9
+ "package-lock.json": "927dbced01899581ee8564f897da89f257c6327b2840b365c2bf18eb7f0ef6c1",
10
10
  "sources/client/class.js": "c3fb8f143fc83aaa2df1ddeddd412d2d4dfe88656578095babe2df34fb3b3922",
11
11
  "sources/client/field.js": "ffdd50fa8b6ec515cc42da5fca96658ff2b20e274601a1f926e0031372467a19",
12
12
  "sources/client/file.js": "667101d75fa30840370d5be232e518aaac7c1fd52ca05a12da560eef6c0848b0",
13
13
  "sources/client/folder.js": "a1f711199a5defd52ea3ad98878d812f08d349428109dddf9305c5e6beb64844",
14
- "sources/client/handler.js": "7c7ac71626beecd1230248a9808dbda2744a21a18e0214568bf957d846991e5f",
14
+ "sources/client/handler.js": "8c19284248fbe61272ef9e59c72e5beaf5cfd3cfab1ee03d0796901d95679b6c",
15
15
  "sources/client/index.js": "037ff635b149a617adf1219d34f0ba9dd936d5f60cea59e62d276a49468c3dc3",
16
16
  "sources/client/readme.md": "a50aa4aa3a90606b2f446e2d29166aa26175ae87539901299e9347322ae4a2fe",
17
17
  "sources/client/user.js": "bd5de82f24ae437291c22c06d21ea32847fdd5b6bc8e6be5efb37058680c9c9f",
@@ -690,7 +690,7 @@
690
690
  "$server/$folder/$class/handlers/pages/form/objects/$handler/objects.js": "e59ce816ef95d3ed4da5e18818fb0e81d55dfbbe50b7ff06cdf43e3b106f18ee",
691
691
  "$server/$folder/$class/handlers/pages/form/readme.md": "6760a39b22785b6370ed4a525b0602c104f7beb64e9e9847894d7c6560902531",
692
692
  "$server/$folder/$class/handlers/pages/storage/$handler/class.js": "145bd7569e5018554eb0e90a27dbeb52d44eb64629268bca7c588d2f1acc44af",
693
- "$server/$folder/$class/handlers/pages/storage/$handler/storage.js": "1de380421e3349feb15a0f4f5d92b5d217131ce470c101d0846cc3941cb349ca",
693
+ "$server/$folder/$class/handlers/pages/storage/$handler/storage.js": "d9c740f3cf300d6563e7760c946ff5250471a2b9f1785512998137ccf617f518",
694
694
  "$server/$folder/$class/icon.png": "b0c0d28bb28125dac7e1305bca10569fb055d856261455d336931bc57a4705c1",
695
695
  "$server/$folder/$class/readme.md": "065de50c55b84bd4a01155d96040e14ebffe51accb6dc828bd62af8f7e131c3c",
696
696
  "$server/$folder/$file/$audio/handlers/preview/$handler/class.js": "a001a5e9aca1a07b906ed08a2b107ae8dd27f26351c294ea8d7b0f1e584b57c7",
@@ -777,7 +777,7 @@
777
777
  "$server/$folder/handlers/methods/help/$handler/class.js": "ff54bf976cbdc846d7c1b46ff12b111e99a3f4831240a4e420b73c98c0355a5c",
778
778
  "$server/$folder/handlers/methods/info/$handler/class.js": "8752efb28abdcfad4e8ce56cfebcd8bb09ec0735cba7b84156d248bfcb0f9db0",
779
779
  "$server/$folder/handlers/pages/form/$handler/class.js": "3902d3e1a8742afa2625410f97c68a3afac2559bd3d8f37044338edf7386d4df",
780
- "$server/$folder/handlers/pages/form/$handler/form.js": "43b82bc0feb947b8a38ad99f32373ca920ba565eb262f3ceb07b938c0845fe17",
780
+ "$server/$folder/handlers/pages/form/$handler/form.js": "28fccc6b116f870e81417c27a8bdb4953f48fcc58aeb9504f9ba3b0f8d5913b9",
781
781
  "$server/$folder/handlers/readme.md": "1167594c32f46323d229098a72e80a9865005c347373fdacef5af69838a0f8eb",
782
782
  "$server/$folder/lib/calendar-form/calendar-form.js": "3035cab0a489c891d7dd7ed52ae5c475068b97361a1f7c855d500a0823614d1c",
783
783
  "$server/$folder/lib/chat-item/chat-item.js": "6af09b84e5ef31c7e22007ba763bccf874d642afeff359414400ec36d4d5c560",
@@ -792,7 +792,7 @@
792
792
  "$server/$folder/lib/dot/readme.md": "22d9981d9b1b39e870623f8eedcc562ed4f6c6638d0ddeb853244bd55df3c60f",
793
793
  "$server/$folder/lib/editor-form/editor-form.js": "7dee223a9613df2f7091e0d330142252a87a438062de9cec56002943745e5ba1",
794
794
  "$server/$folder/lib/email/settings.js": "25e13ecf12b84e5fd6bcac955b1e0dc47bf09b72a98776e8ce1e1f01617aef9d",
795
- "$server/$folder/lib/explorer/explorer.js": "c624b6a1e132ef6fb3e29b09dec44ae6be03738dded798d6679f12ad1633ec67",
795
+ "$server/$folder/lib/explorer/explorer.js": "96004ccf61f456c1b3118a6e5180d851a268f0e0caa9cf0bc5e9dfa077e6d060",
796
796
  "$server/$folder/lib/file-viewer/file-viewer.js": "b183fd61b72fcc7baba3e44e16ddf3800553596313711a7bc4dd91f3e1e260ab",
797
797
  "$server/$folder/lib/icon/icon.js": "fdb15cf37421b60d3362f3c47a2a759a2faafe194547841718ad448df36462d0",
798
798
  "$server/$folder/lib/icon/user/user.js": "481da79de754c244f0151c91d03a503c0452902575e4dc8bc2b3171c0fad3a2e",
@@ -1,21 +1,21 @@
1
- export default {
2
- icon: 'bootstrap:database-fill-gear',
3
- imports: '~/lib//explorer.js',
4
- extends: 'item-explorer',
5
- hideTops: 0,
6
- hideRoots: 1,
7
- showSize: true,
8
- itemsSelector: 'entries',
9
- async ready() {
10
- if (this.$item) {
11
- this.$context = this.$item;
12
- this.$item = undefined;
13
- this.$item = await this.$context.storage_folder;
14
- }
15
- },
16
- $public: {
17
- get allowUse() {
18
- return this.$item?.connstructor?.name !== '$file'
19
- }
20
- }
21
- }
1
+ export default {
2
+ icon: 'bootstrap:database-fill-gear',
3
+ imports: '~/lib//explorer.js',
4
+ extends: 'item-explorer',
5
+ hideTops: 0,
6
+ hideRoots: 1,
7
+ showSize: true,
8
+ itemsSelector: 'entries',
9
+ async ready() {
10
+ if (this.$item) {
11
+ this.$context = this.$item;
12
+ this.$item = undefined;
13
+ this.$item = await this.$context.storage_folder;
14
+ }
15
+ },
16
+ $public: {
17
+ get allowUse() {
18
+ return this.$item?.constructor?.name !== '$file';
19
+ }
20
+ }
21
+ }
@@ -913,9 +913,10 @@ ODA({is: 'work-form',
913
913
  },
914
914
  openDataPage() {
915
915
  const target = this.currentItem;
916
- const execFn = (typeof window !== 'undefined' && (window.top?.execute || window.execute)) || null;
917
- if (target && execFn)
918
- execFn(target, { page: 'data' });
916
+ if (!target)
917
+ return;
918
+ const short = target.short || target.path || '';
919
+ window.open(encodeURI(`${short}/~/handlers/pages/data/index.html`), '_blank');
919
920
  },
920
921
  get hasClassTree() {
921
922
  if (this._noClassTreeFlag)
@@ -31,6 +31,8 @@ export default {
31
31
  bookmarks: [],
32
32
  focusedPage: '',
33
33
  get hasBookmarks() {
34
+ if (typeof window !== 'undefined' && window !== window.top)
35
+ return false;
34
36
  return !this.mobile && Array.isArray(this.bookmarks) && this.bookmarks.length > 0 && this.visibleMode === 'main';
35
37
  },
36
38
  get bookmarkTabItems() {
@@ -101,6 +103,8 @@ export default {
101
103
  * через ~props логический `hidden` не применяет, поэтому кнопка висела всегда.
102
104
  */
103
105
  _buildLeftButtons() {
106
+ if (typeof window !== 'undefined' && window !== window.top)
107
+ return [];
104
108
  const user = WORK.USER;
105
109
  const buttons = [];
106
110
  if (top.RTCCaller?.current_call) {
@@ -197,7 +201,7 @@ export default {
197
201
  get icon() {
198
202
  return this.$handler?.icon;
199
203
  },
200
- hideRoots: 1,
204
+ hideRoots: 2,
201
205
  hideTops: 0,
202
206
  itemsSelector: 'items',
203
207
 
@@ -373,7 +377,7 @@ export default {
373
377
  }
374
378
  catch { /* ignore */ }
375
379
  },
376
- _upsertBookmarkForUrl(pageUrl, $item = null, pagePrefix = '', pageIcon = '') {
380
+ _upsertBookmarkForUrl(pageUrl, $item = null) {
377
381
  if (!pageUrl)
378
382
  return null;
379
383
  const short = $item?.short || $item?.path || this._extractShortFromUrl(pageUrl);
@@ -384,8 +388,7 @@ export default {
384
388
  if (!bm) {
385
389
  const lastSeg = String(short || '').split('/').filter(Boolean).pop() || '';
386
390
  const dated = CORE?.$file?.formatDatedFileLabel?.($item?.id || lastSeg, $item?.DATA?.label);
387
- const baseLabel = dated || $item?.DATA?.label || $item?.label || this._defaultLabelForShort(short);
388
- const label = pagePrefix ? `${pagePrefix} · ${baseLabel}` : baseLabel;
391
+ const label = dated || $item?.DATA?.label || $item?.label || this._defaultLabelForShort(short);
389
392
  bm = {
390
393
  url: pageUrl,
391
394
  hash,
@@ -393,17 +396,15 @@ export default {
393
396
  stateKey: itemStateKey,
394
397
  label,
395
398
  title: `${label} (${short})`,
396
- icon: pageIcon || this._defaultIconForItem($item, short),
399
+ icon: this._defaultIconForItem($item, short),
397
400
  };
398
401
  list.push(bm);
399
402
  this.bookmarks = list;
400
- if (!pagePrefix)
401
- setTimeout(() => this._hydrateBookmarkMeta(bm, { cachedOnly: true }), 800);
403
+ setTimeout(() => this._hydrateBookmarkMeta(bm, { cachedOnly: true }), 800);
402
404
  }
403
405
  else if ($item) {
404
- const baseLabel = $item?.DATA?.label || $item?.label || bm.label;
405
- const label = pagePrefix ? `${pagePrefix} · ${baseLabel}` : baseLabel;
406
- const icon = pageIcon || this._defaultIconForItem($item, short);
406
+ const label = $item?.DATA?.label || $item?.label || bm.label;
407
+ const icon = this._defaultIconForItem($item, short);
407
408
  if (itemStateKey)
408
409
  bm.stateKey = itemStateKey;
409
410
  if (bm.label !== label || bm.icon !== icon) {
@@ -676,30 +677,22 @@ export default {
676
677
  window.execute = async ($item, nav) => {
677
678
  if (!$item)
678
679
  return;
679
- let pageHandlerMeta = null;
680
680
  if ($item.type === '$handler') {
681
681
  const rawHPath = String($item.path || $item.short || '');
682
- const mPage = rawHPath.match(/^(.*?)\/(?:~|\$[^/]+(?:\/\$[^/]+)*)\/handlers\/pages\/([^/$]+)(?:\/([^/$]+))?/);
682
+ const mForm = rawHPath.match(/^(.*?)\/(?:~|\$[^/]+(?:\/\$[^/]+)*)\/handlers\/pages\/form(?:\/([^/$]+))?/);
683
683
  const rawSelf = $item[R]?.target || $item;
684
684
  const ctx = (Object.prototype.hasOwnProperty.call(rawSelf, '$context') || Object.prototype.hasOwnProperty.call($item, '$context'))
685
685
  ? await $item.$context
686
686
  : null;
687
687
  if (ctx && ctx.type !== '$handler') {
688
- const pageName = mPage?.[2] || 'form';
689
- const viewId = pageName === 'form' ? (mPage?.[3] || ($item.id && $item.id !== 'form' ? $item.id : '')) : '';
690
- pageHandlerMeta = pageName !== 'form'
691
- ? { page: pageName, label: $item.DATA?.label || $item.label || pageName, icon: $item.DATA?.icon || $item.icon || '' }
692
- : null;
688
+ const viewId = mForm?.[2] || ($item.id && $item.id !== 'form' ? $item.id : '');
693
689
  $item = ctx;
694
- nav = {
695
- ...(nav && typeof nav === 'object' ? nav : {}),
696
- ...(pageName !== 'form' ? { page: pageName } : (viewId ? { view: viewId } : {})),
697
- };
690
+ if (viewId)
691
+ nav = { ...(nav && typeof nav === 'object' ? nav : {}), view: viewId };
698
692
  }
699
693
  }
700
- const pageName = ($item.type !== '$handler' && nav?.page) ? String(nav.page) : ($item.page || 'form');
701
694
  const short = $item?.short ?? $item?.path ?? '';
702
- const dataRoot = ($item?.type !== '$handler' && pageName === 'form') ? this._resolveDataRootPath(short, $item) : '';
695
+ const dataRoot = ($item?.type !== '$handler') ? this._resolveDataRootPath(short, $item) : '';
703
696
  const openShort = dataRoot || short;
704
697
  const navKey = openShort || '/';
705
698
  const effectiveNav = dataRoot
@@ -714,13 +707,12 @@ export default {
714
707
  }
715
708
  let hash = '#' + openShort;
716
709
  if ($item.type !== '$handler')
717
- hash += '/~/handlers/pages/' + pageName;
718
- history.replaceState(null, '', window.location.pathname + hash);
719
- const fullUrl = encodeURI(window.location.origin + openShort + ($item.type !== '$handler' ? '/~/handlers/pages/' + pageName : '') + '/index.html');
720
- const pageLabelPrefix = pageName !== 'form'
721
- ? (pageHandlerMeta?.label || ({ data: 'Данные', site: 'Сайт', storage: 'Хранилище', explorer: 'Проводник' }[pageName]) || pageName)
722
- : '';
723
- const bm = this._upsertBookmarkForUrl(fullUrl, openShort === short ? $item : null, pageLabelPrefix, pageHandlerMeta?.icon || (pageName === 'data' ? 'carbon:data-base' : ''));
710
+ hash += '/~/handlers/pages/' + ($item.page || 'form');
711
+ const isTop = typeof window === 'undefined' || window === window.top;
712
+ if (isTop)
713
+ history.replaceState(null, '', window.location.pathname + hash);
714
+ const fullUrl = encodeURI(window.location.origin + openShort + ($item.type !== '$handler' ? '/~/handlers/pages/' + ($item.page || 'form') : '') + '/index.html');
715
+ const bm = isTop ? this._upsertBookmarkForUrl(fullUrl, openShort === short ? $item : null) : null;
724
716
  if (openShort !== short && bm) {
725
717
  const itemStateKey = ($item && ('_stateKey' in Object($item)) && $item._stateKey) ? String($item._stateKey) : '';
726
718
  if (itemStateKey && itemStateKey.includes('#place:') && itemStateKey.includes('->')) {
@@ -786,6 +778,11 @@ export default {
786
778
  }
787
779
  }
788
780
  }
781
+ const isTop = typeof window === 'undefined' || window === window.top;
782
+ if (!isTop) {
783
+ this.load_page();
784
+ return;
785
+ }
789
786
  const restored = this._restoreBookmarksState();
790
787
  const hasInitialHash = Boolean(window.location.hash && window.location.hash !== '#');
791
788
  if (!hasInitialHash && restored?.activeUrl) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "odant-work",
3
- "version": "1.0.67",
3
+ "version": "1.0.68",
4
4
  "description": "ODANT-WORK — платформа цифровой организации (встроенная система учёта, документооборот, управление процессами и приватный мультимодальный ИИ)",
5
5
  "type": "module",
6
6
  "main": "sources/work.js",
@@ -67,36 +67,17 @@ export class $handler extends $class{
67
67
  }
68
68
  async execute(...params) {
69
69
  const rawPath = String(this.path || this.short || '');
70
- const pageMatch = rawPath.match(/\/handlers\/pages\/([^/$]+)(?:\/([^/$]+))?/);
71
- const execFn = (typeof window !== 'undefined' && (window.execute || window.top?.execute)) || null;
72
- if (pageMatch && execFn) {
73
- const pageName = pageMatch[1];
74
- const subView = pageMatch[2] || '';
70
+ const formViewMatch = rawPath.match(/\/handlers\/pages\/form(?:\/([^/$]+))?/);
71
+ if (formViewMatch && window.execute) {
72
+ const viewId = formViewMatch[1] || (this.id && this.id !== 'form' ? this.id : '');
75
73
  const rawSelf = this[R]?.target || this;
76
74
  const hasOwnCtx = Object.prototype.hasOwnProperty.call(rawSelf, '$context') || Object.prototype.hasOwnProperty.call(this, '$context');
77
75
  const ctx = hasOwnCtx ? await this.$context : null;
78
- const ev = params?.[0];
79
- if (ev?.ctrlKey || ev?.shiftKey || ev?.metaKey) {
80
- const targetShort = (ctx && ctx.type !== '$handler' ? ctx.short : this.short) || '';
81
- const url = (ctx && ctx.type !== '$handler')
82
- ? `${targetShort}/~/handlers/pages/${pageName}/`
83
- : `${this.short}/`;
84
- window.open(encodeURI(url), '_blank');
85
- return;
86
- }
87
- let nav;
88
- if (pageName === 'form') {
89
- const viewId = subView || (this.id && this.id !== 'form' ? this.id : '');
90
- nav = viewId ? { view: viewId } : undefined;
91
- }
92
- else {
93
- nav = { page: pageName };
94
- }
95
76
  if (ctx && ctx.type !== '$handler') {
96
- execFn(ctx, nav);
77
+ window.execute(ctx, viewId ? { view: viewId } : undefined);
97
78
  return;
98
79
  }
99
- execFn(this, nav);
80
+ window.execute(this, viewId ? { view: viewId } : undefined);
100
81
  return;
101
82
  }
102
83
 
@@ -106,11 +87,18 @@ export class $handler extends $class{
106
87
  return;
107
88
  }
108
89
 
109
- if (this.short.includes('form') && execFn) {
110
- execFn(this);
90
+ if (this.short.includes('form') && window.execute) {
91
+ window.execute(this);
111
92
  return;
112
93
  }
113
- window.open(this.short + '/');
94
+ const pageMatch = rawPath.match(/\/handlers\/pages\/([^/$]+)/);
95
+ const rawSelf = this[R]?.target || this;
96
+ const hasOwnCtx = Object.prototype.hasOwnProperty.call(rawSelf, '$context') || Object.prototype.hasOwnProperty.call(this, '$context');
97
+ const ctx = hasOwnCtx ? await this.$context : null;
98
+ const url = (pageMatch && ctx && ctx.type !== '$handler')
99
+ ? `${ctx.short || ctx.path || ''}/~/handlers/pages/${pageMatch[1]}/`
100
+ : `${this.short}/`;
101
+ window.open(encodeURI(url), '_blank');
114
102
  }
115
103
  async showSettings(...params) {
116
104
  const module = await this.getModule();