imdone-core 1.53.0 → 1.53.2

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/README.md CHANGED
@@ -201,3 +201,16 @@ License
201
201
  - #BACKLOG:-550 As a vscode user I would like to see the imdone board in vscode so I can get shit done! ic:gh gh:132 id:30 +enhancement
202
202
 
203
203
  -->
204
+ # #NOTE Notes
205
+
206
+ [Focus]({{getFilterURL('list = DOING or tags = focus')}})
207
+ [Plan]({{getFilterURL(' ')}})
208
+
209
+ <!--
210
+ expand:1
211
+ #focus
212
+ created:2025-02-01T19:22:41.979Z
213
+ order:0
214
+ -->
215
+
216
+
@@ -83,7 +83,7 @@ function replaceImagePaths(filePath) {
83
83
  const srcIndex = token.attrIndex('src');
84
84
  if (srcIndex >= 0) {
85
85
  const src = token.attrs[srcIndex][1];
86
- const srcUrl = isFileLink(src) && resolveFileUrl(src, filePath)
86
+ const srcUrl = !isUrl(src) && resolveFileUrl(src, filePath)
87
87
  if (srcUrl) token.attrs[srcIndex][1] = srcUrl;
88
88
  }
89
89
 
@@ -104,7 +104,7 @@ function replaceLinkPaths(filePath) {
104
104
  const srcIndex = token.attrIndex('href');
105
105
  if (srcIndex >= 0) {
106
106
  const src = token.attrs[srcIndex][1];
107
- const srcUrl = isFileLink(src) && resolveFileUrl(src, filePath)
107
+ const srcUrl = !isUrl(src) && resolveFileUrl(src, filePath)
108
108
  if (srcUrl) token.attrs[srcIndex][1] = srcUrl;
109
109
  }
110
110
 
@@ -113,8 +113,13 @@ function replaceLinkPaths(filePath) {
113
113
  }
114
114
  }
115
115
 
116
- function isFileLink(href) {
117
- return !/^(http|https|mailto):/.test(href)
116
+ function isUrl(href) {
117
+ try {
118
+ new URL(href);
119
+ return true;
120
+ } catch (e) {
121
+ return false;
122
+ }
118
123
  }
119
124
 
120
125
  function resolveFileUrl(src, filePath) {
@@ -122,7 +127,7 @@ function resolveFileUrl(src, filePath) {
122
127
  const resolve = _platform === 'win32' ? path.win32.resolve : path.resolve;
123
128
 
124
129
  if (src.startsWith('file://')) return src;
125
- if (src === '/') src = './';
130
+ if (/^\.?\/$/.test(src)) src = './';
126
131
  const srcDir = dirname(filePath);
127
132
  const srcPath = resolve(srcDir, src) // filePath ? path.join(filePath, src) : path.resolve(src);
128
133
  const srcUrl = pathToFileURL(srcPath);
package/lib/card.js CHANGED
@@ -8,7 +8,6 @@ const _isEmpty = require('lodash.isempty')
8
8
  const _get = require('lodash.get')
9
9
  const eol = require('eol')
10
10
  const allEmoji = require('markdown-it-emoji/lib/data/full.json')
11
- const { getIsoDateWithOffset } = require('./adapters/date-time')
12
11
 
13
12
  const { removeMD } = require('./adapters/markdown')
14
13
 
@@ -105,7 +104,6 @@ module.exports = function newCard(task, _project, dontParse) {
105
104
 
106
105
  get defaultData() {
107
106
  return {
108
- timestamp: getIsoDateWithOffset(),
109
107
  ..._pick(
110
108
  this,
111
109
  ...['beforeText',
@@ -0,0 +1,24 @@
1
+ const Plugin = require('imdone-api')
2
+ const {getIsoDateWithOffset} = require('../adapters/date-time')
3
+
4
+ module.exports = class DefaultCardPropertiesPlugin extends Plugin {
5
+ constructor(project) {
6
+ super(project)
7
+ }
8
+
9
+ getCardProperties() {
10
+ const self = this;
11
+
12
+ return {
13
+ date: `${getIsoDateWithOffset(new Date()).substring(0, 10)}`,
14
+ timestamp: getIsoDateWithOffset(new Date()),
15
+ getFilterURL: (filter) => self.getFilterURL(filter),
16
+ getFilterLink: (filter) => `[Filter By: ${filter}](${self.getFilterURL(filter)})`
17
+ }
18
+ }
19
+
20
+ getFilterURL(filter) {
21
+ return `imdone://${this.project.path}?filter=${filter}`
22
+ }
23
+
24
+ }
@@ -12,11 +12,12 @@ module.exports = class PluginManager extends Emitter {
12
12
  super()
13
13
  this.project = project
14
14
  this.defaultPlugins = [
15
+ './persist-tags-plugin',
16
+ './default-card-properties-plugin',
15
17
  './default-board-actions-plugin',
16
18
  './archive-plugin',
17
19
  './epic-plugin',
18
20
  './extension-plugin',
19
- './persist-tags-plugin',
20
21
  ]
21
22
  this.pluginsMap = {}
22
23
  this.pluginPath = _path.join(project.path, '.imdone', 'plugins')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imdone-core",
3
- "version": "1.53.0",
3
+ "version": "1.53.2",
4
4
  "description": "imdone-core",
5
5
  "main": "index.js",
6
6
  "scripts": {