@industry-theme/backlogmd-kanban-panel 1.0.41 → 1.0.42
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/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/mocks/panelContext.d.ts.map +1 -1
- package/dist/panels/KanbanPanel.d.ts.map +1 -1
- package/dist/panels/kanban/components/BoardEmptyState.d.ts.map +1 -1
- package/dist/panels/kanban/hooks/useKanbanData.d.ts +2 -2
- package/dist/panels/kanban/hooks/useKanbanData.d.ts.map +1 -1
- package/dist/panels.bundle.js +1213 -255
- package/dist/panels.bundle.js.map +1 -1
- package/dist/telemetry.d.ts +36 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/package.json +7 -1
package/dist/panels.bundle.js
CHANGED
|
@@ -1132,7 +1132,7 @@ class KeyboardSensor {
|
|
|
1132
1132
|
if (isKeyboardEvent(event)) {
|
|
1133
1133
|
const {
|
|
1134
1134
|
active,
|
|
1135
|
-
context,
|
|
1135
|
+
context: context2,
|
|
1136
1136
|
options
|
|
1137
1137
|
} = this.props;
|
|
1138
1138
|
const {
|
|
@@ -1153,7 +1153,7 @@ class KeyboardSensor {
|
|
|
1153
1153
|
}
|
|
1154
1154
|
const {
|
|
1155
1155
|
collisionRect
|
|
1156
|
-
} =
|
|
1156
|
+
} = context2.current;
|
|
1157
1157
|
const currentCoordinates = collisionRect ? {
|
|
1158
1158
|
x: collisionRect.left,
|
|
1159
1159
|
y: collisionRect.top
|
|
@@ -1163,7 +1163,7 @@ class KeyboardSensor {
|
|
|
1163
1163
|
}
|
|
1164
1164
|
const newCoordinates = coordinateGetter(event, {
|
|
1165
1165
|
active,
|
|
1166
|
-
context:
|
|
1166
|
+
context: context2.current,
|
|
1167
1167
|
currentCoordinates
|
|
1168
1168
|
});
|
|
1169
1169
|
if (newCoordinates) {
|
|
@@ -1174,7 +1174,7 @@ class KeyboardSensor {
|
|
|
1174
1174
|
};
|
|
1175
1175
|
const {
|
|
1176
1176
|
scrollableAncestors
|
|
1177
|
-
} =
|
|
1177
|
+
} = context2.current;
|
|
1178
1178
|
for (const scrollContainer of scrollableAncestors) {
|
|
1179
1179
|
const direction = event.code;
|
|
1180
1180
|
const {
|
|
@@ -3026,7 +3026,7 @@ const DndContext = /* @__PURE__ */ memo(function DndContext2(_ref) {
|
|
|
3026
3026
|
scrollableAncestorRects
|
|
3027
3027
|
});
|
|
3028
3028
|
const publicContext = useMemo(() => {
|
|
3029
|
-
const
|
|
3029
|
+
const context2 = {
|
|
3030
3030
|
active,
|
|
3031
3031
|
activeNode,
|
|
3032
3032
|
activeNodeRect,
|
|
@@ -3045,10 +3045,10 @@ const DndContext = /* @__PURE__ */ memo(function DndContext2(_ref) {
|
|
|
3045
3045
|
measuringScheduled,
|
|
3046
3046
|
windowRect
|
|
3047
3047
|
};
|
|
3048
|
-
return
|
|
3048
|
+
return context2;
|
|
3049
3049
|
}, [active, activeNode, activeNodeRect, activatorEvent, collisions, containerNodeRect, dragOverlay, draggableNodes, droppableContainers, droppableRects, over, measureDroppableContainers, scrollableAncestors, scrollableAncestorRects, measuringConfiguration, measuringScheduled, windowRect]);
|
|
3050
3050
|
const internalContext = useMemo(() => {
|
|
3051
|
-
const
|
|
3051
|
+
const context2 = {
|
|
3052
3052
|
activatorEvent,
|
|
3053
3053
|
activators,
|
|
3054
3054
|
active,
|
|
@@ -3061,7 +3061,7 @@ const DndContext = /* @__PURE__ */ memo(function DndContext2(_ref) {
|
|
|
3061
3061
|
over,
|
|
3062
3062
|
measureDroppableContainers
|
|
3063
3063
|
};
|
|
3064
|
-
return
|
|
3064
|
+
return context2;
|
|
3065
3065
|
}, [activatorEvent, activators, active, activeNodeRect, dispatch, draggableDescribedById, draggableNodes, over, measureDroppableContainers]);
|
|
3066
3066
|
return React2__default.createElement(DndMonitorContext.Provider, {
|
|
3067
3067
|
value: registerMonitorListener
|
|
@@ -4057,11 +4057,11 @@ var getThemeContext$1 = () => {
|
|
|
4057
4057
|
};
|
|
4058
4058
|
var ThemeContextSingleton = getThemeContext$1();
|
|
4059
4059
|
var useTheme = () => {
|
|
4060
|
-
const
|
|
4061
|
-
if (!
|
|
4060
|
+
const context2 = useContext(ThemeContextSingleton);
|
|
4061
|
+
if (!context2) {
|
|
4062
4062
|
throw new Error("useTheme must be used within a ThemeProvider");
|
|
4063
4063
|
}
|
|
4064
|
-
return
|
|
4064
|
+
return context2;
|
|
4065
4065
|
};
|
|
4066
4066
|
const PanelGroupContext$1 = createContext(null);
|
|
4067
4067
|
PanelGroupContext$1.displayName = "PanelGroupContext";
|
|
@@ -4106,8 +4106,8 @@ function PanelWithForwardedRef$1({
|
|
|
4106
4106
|
tagName: Type = "div",
|
|
4107
4107
|
...rest
|
|
4108
4108
|
}) {
|
|
4109
|
-
const
|
|
4110
|
-
if (
|
|
4109
|
+
const context2 = useContext(PanelGroupContext$1);
|
|
4110
|
+
if (context2 === null) {
|
|
4111
4111
|
throw Error(`Panel components must be rendered within a PanelGroup container`);
|
|
4112
4112
|
}
|
|
4113
4113
|
const {
|
|
@@ -4121,7 +4121,7 @@ function PanelWithForwardedRef$1({
|
|
|
4121
4121
|
registerPanel,
|
|
4122
4122
|
resizePanel: resizePanel2,
|
|
4123
4123
|
unregisterPanel
|
|
4124
|
-
} =
|
|
4124
|
+
} = context2;
|
|
4125
4125
|
const panelId = useUniqueId$1(idFromProps);
|
|
4126
4126
|
const panelDataRef = useRef({
|
|
4127
4127
|
callbacks: {
|
|
@@ -5486,7 +5486,7 @@ function PanelGroupWithForwardedRef$1({
|
|
|
5486
5486
|
forceUpdate();
|
|
5487
5487
|
}
|
|
5488
5488
|
}, [forceUpdate]);
|
|
5489
|
-
const
|
|
5489
|
+
const context2 = useMemo(() => ({
|
|
5490
5490
|
collapsePanel,
|
|
5491
5491
|
direction,
|
|
5492
5492
|
dragState,
|
|
@@ -5513,7 +5513,7 @@ function PanelGroupWithForwardedRef$1({
|
|
|
5513
5513
|
width: "100%"
|
|
5514
5514
|
};
|
|
5515
5515
|
return createElement(PanelGroupContext$1.Provider, {
|
|
5516
|
-
value:
|
|
5516
|
+
value: context2
|
|
5517
5517
|
}, createElement(Type, {
|
|
5518
5518
|
...rest,
|
|
5519
5519
|
children: children2,
|
|
@@ -7981,6 +7981,724 @@ class PanelFileSystemAdapter {
|
|
|
7981
7981
|
return path2.replace(/^\/+/, "").replace(/\/+$/, "").replace(/\/+/g, "/");
|
|
7982
7982
|
}
|
|
7983
7983
|
}
|
|
7984
|
+
var _globalThis = typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : typeof window === "object" ? window : typeof global === "object" ? global : {};
|
|
7985
|
+
var VERSION = "1.9.0";
|
|
7986
|
+
var re$1 = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;
|
|
7987
|
+
function _makeCompatibilityCheck(ownVersion) {
|
|
7988
|
+
var acceptedVersions = /* @__PURE__ */ new Set([ownVersion]);
|
|
7989
|
+
var rejectedVersions = /* @__PURE__ */ new Set();
|
|
7990
|
+
var myVersionMatch = ownVersion.match(re$1);
|
|
7991
|
+
if (!myVersionMatch) {
|
|
7992
|
+
return function() {
|
|
7993
|
+
return false;
|
|
7994
|
+
};
|
|
7995
|
+
}
|
|
7996
|
+
var ownVersionParsed = {
|
|
7997
|
+
major: +myVersionMatch[1],
|
|
7998
|
+
minor: +myVersionMatch[2],
|
|
7999
|
+
patch: +myVersionMatch[3],
|
|
8000
|
+
prerelease: myVersionMatch[4]
|
|
8001
|
+
};
|
|
8002
|
+
if (ownVersionParsed.prerelease != null) {
|
|
8003
|
+
return function isExactmatch(globalVersion) {
|
|
8004
|
+
return globalVersion === ownVersion;
|
|
8005
|
+
};
|
|
8006
|
+
}
|
|
8007
|
+
function _reject(v) {
|
|
8008
|
+
rejectedVersions.add(v);
|
|
8009
|
+
return false;
|
|
8010
|
+
}
|
|
8011
|
+
function _accept(v) {
|
|
8012
|
+
acceptedVersions.add(v);
|
|
8013
|
+
return true;
|
|
8014
|
+
}
|
|
8015
|
+
return function isCompatible2(globalVersion) {
|
|
8016
|
+
if (acceptedVersions.has(globalVersion)) {
|
|
8017
|
+
return true;
|
|
8018
|
+
}
|
|
8019
|
+
if (rejectedVersions.has(globalVersion)) {
|
|
8020
|
+
return false;
|
|
8021
|
+
}
|
|
8022
|
+
var globalVersionMatch = globalVersion.match(re$1);
|
|
8023
|
+
if (!globalVersionMatch) {
|
|
8024
|
+
return _reject(globalVersion);
|
|
8025
|
+
}
|
|
8026
|
+
var globalVersionParsed = {
|
|
8027
|
+
major: +globalVersionMatch[1],
|
|
8028
|
+
minor: +globalVersionMatch[2],
|
|
8029
|
+
patch: +globalVersionMatch[3],
|
|
8030
|
+
prerelease: globalVersionMatch[4]
|
|
8031
|
+
};
|
|
8032
|
+
if (globalVersionParsed.prerelease != null) {
|
|
8033
|
+
return _reject(globalVersion);
|
|
8034
|
+
}
|
|
8035
|
+
if (ownVersionParsed.major !== globalVersionParsed.major) {
|
|
8036
|
+
return _reject(globalVersion);
|
|
8037
|
+
}
|
|
8038
|
+
if (ownVersionParsed.major === 0) {
|
|
8039
|
+
if (ownVersionParsed.minor === globalVersionParsed.minor && ownVersionParsed.patch <= globalVersionParsed.patch) {
|
|
8040
|
+
return _accept(globalVersion);
|
|
8041
|
+
}
|
|
8042
|
+
return _reject(globalVersion);
|
|
8043
|
+
}
|
|
8044
|
+
if (ownVersionParsed.minor <= globalVersionParsed.minor) {
|
|
8045
|
+
return _accept(globalVersion);
|
|
8046
|
+
}
|
|
8047
|
+
return _reject(globalVersion);
|
|
8048
|
+
};
|
|
8049
|
+
}
|
|
8050
|
+
var isCompatible = _makeCompatibilityCheck(VERSION);
|
|
8051
|
+
var major = VERSION.split(".")[0];
|
|
8052
|
+
var GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for("opentelemetry.js.api." + major);
|
|
8053
|
+
var _global = _globalThis;
|
|
8054
|
+
function registerGlobal(type, instance, diag, allowOverride) {
|
|
8055
|
+
var _a;
|
|
8056
|
+
if (allowOverride === void 0) {
|
|
8057
|
+
allowOverride = false;
|
|
8058
|
+
}
|
|
8059
|
+
var api = _global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a !== void 0 ? _a : {
|
|
8060
|
+
version: VERSION
|
|
8061
|
+
};
|
|
8062
|
+
if (!allowOverride && api[type]) {
|
|
8063
|
+
var err = new Error("@opentelemetry/api: Attempted duplicate registration of API: " + type);
|
|
8064
|
+
diag.error(err.stack || err.message);
|
|
8065
|
+
return false;
|
|
8066
|
+
}
|
|
8067
|
+
if (api.version !== VERSION) {
|
|
8068
|
+
var err = new Error("@opentelemetry/api: Registration of version v" + api.version + " for " + type + " does not match previously registered API v" + VERSION);
|
|
8069
|
+
diag.error(err.stack || err.message);
|
|
8070
|
+
return false;
|
|
8071
|
+
}
|
|
8072
|
+
api[type] = instance;
|
|
8073
|
+
diag.debug("@opentelemetry/api: Registered a global for " + type + " v" + VERSION + ".");
|
|
8074
|
+
return true;
|
|
8075
|
+
}
|
|
8076
|
+
function getGlobal(type) {
|
|
8077
|
+
var _a, _b;
|
|
8078
|
+
var globalVersion = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a === void 0 ? void 0 : _a.version;
|
|
8079
|
+
if (!globalVersion || !isCompatible(globalVersion)) {
|
|
8080
|
+
return;
|
|
8081
|
+
}
|
|
8082
|
+
return (_b = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b === void 0 ? void 0 : _b[type];
|
|
8083
|
+
}
|
|
8084
|
+
function unregisterGlobal(type, diag) {
|
|
8085
|
+
diag.debug("@opentelemetry/api: Unregistering a global for " + type + " v" + VERSION + ".");
|
|
8086
|
+
var api = _global[GLOBAL_OPENTELEMETRY_API_KEY];
|
|
8087
|
+
if (api) {
|
|
8088
|
+
delete api[type];
|
|
8089
|
+
}
|
|
8090
|
+
}
|
|
8091
|
+
var __read$3 = function(o, n) {
|
|
8092
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
8093
|
+
if (!m) return o;
|
|
8094
|
+
var i = m.call(o), r2, ar = [], e;
|
|
8095
|
+
try {
|
|
8096
|
+
while ((n === void 0 || n-- > 0) && !(r2 = i.next()).done) ar.push(r2.value);
|
|
8097
|
+
} catch (error) {
|
|
8098
|
+
e = { error };
|
|
8099
|
+
} finally {
|
|
8100
|
+
try {
|
|
8101
|
+
if (r2 && !r2.done && (m = i["return"])) m.call(i);
|
|
8102
|
+
} finally {
|
|
8103
|
+
if (e) throw e.error;
|
|
8104
|
+
}
|
|
8105
|
+
}
|
|
8106
|
+
return ar;
|
|
8107
|
+
};
|
|
8108
|
+
var __spreadArray$4 = function(to, from, pack) {
|
|
8109
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
8110
|
+
if (ar || !(i in from)) {
|
|
8111
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
8112
|
+
ar[i] = from[i];
|
|
8113
|
+
}
|
|
8114
|
+
}
|
|
8115
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
8116
|
+
};
|
|
8117
|
+
var DiagComponentLogger = (
|
|
8118
|
+
/** @class */
|
|
8119
|
+
(function() {
|
|
8120
|
+
function DiagComponentLogger2(props) {
|
|
8121
|
+
this._namespace = props.namespace || "DiagComponentLogger";
|
|
8122
|
+
}
|
|
8123
|
+
DiagComponentLogger2.prototype.debug = function() {
|
|
8124
|
+
var args = [];
|
|
8125
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
8126
|
+
args[_i] = arguments[_i];
|
|
8127
|
+
}
|
|
8128
|
+
return logProxy("debug", this._namespace, args);
|
|
8129
|
+
};
|
|
8130
|
+
DiagComponentLogger2.prototype.error = function() {
|
|
8131
|
+
var args = [];
|
|
8132
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
8133
|
+
args[_i] = arguments[_i];
|
|
8134
|
+
}
|
|
8135
|
+
return logProxy("error", this._namespace, args);
|
|
8136
|
+
};
|
|
8137
|
+
DiagComponentLogger2.prototype.info = function() {
|
|
8138
|
+
var args = [];
|
|
8139
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
8140
|
+
args[_i] = arguments[_i];
|
|
8141
|
+
}
|
|
8142
|
+
return logProxy("info", this._namespace, args);
|
|
8143
|
+
};
|
|
8144
|
+
DiagComponentLogger2.prototype.warn = function() {
|
|
8145
|
+
var args = [];
|
|
8146
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
8147
|
+
args[_i] = arguments[_i];
|
|
8148
|
+
}
|
|
8149
|
+
return logProxy("warn", this._namespace, args);
|
|
8150
|
+
};
|
|
8151
|
+
DiagComponentLogger2.prototype.verbose = function() {
|
|
8152
|
+
var args = [];
|
|
8153
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
8154
|
+
args[_i] = arguments[_i];
|
|
8155
|
+
}
|
|
8156
|
+
return logProxy("verbose", this._namespace, args);
|
|
8157
|
+
};
|
|
8158
|
+
return DiagComponentLogger2;
|
|
8159
|
+
})()
|
|
8160
|
+
);
|
|
8161
|
+
function logProxy(funcName, namespace, args) {
|
|
8162
|
+
var logger = getGlobal("diag");
|
|
8163
|
+
if (!logger) {
|
|
8164
|
+
return;
|
|
8165
|
+
}
|
|
8166
|
+
args.unshift(namespace);
|
|
8167
|
+
return logger[funcName].apply(logger, __spreadArray$4([], __read$3(args), false));
|
|
8168
|
+
}
|
|
8169
|
+
var DiagLogLevel;
|
|
8170
|
+
(function(DiagLogLevel2) {
|
|
8171
|
+
DiagLogLevel2[DiagLogLevel2["NONE"] = 0] = "NONE";
|
|
8172
|
+
DiagLogLevel2[DiagLogLevel2["ERROR"] = 30] = "ERROR";
|
|
8173
|
+
DiagLogLevel2[DiagLogLevel2["WARN"] = 50] = "WARN";
|
|
8174
|
+
DiagLogLevel2[DiagLogLevel2["INFO"] = 60] = "INFO";
|
|
8175
|
+
DiagLogLevel2[DiagLogLevel2["DEBUG"] = 70] = "DEBUG";
|
|
8176
|
+
DiagLogLevel2[DiagLogLevel2["VERBOSE"] = 80] = "VERBOSE";
|
|
8177
|
+
DiagLogLevel2[DiagLogLevel2["ALL"] = 9999] = "ALL";
|
|
8178
|
+
})(DiagLogLevel || (DiagLogLevel = {}));
|
|
8179
|
+
function createLogLevelDiagLogger(maxLevel, logger) {
|
|
8180
|
+
if (maxLevel < DiagLogLevel.NONE) {
|
|
8181
|
+
maxLevel = DiagLogLevel.NONE;
|
|
8182
|
+
} else if (maxLevel > DiagLogLevel.ALL) {
|
|
8183
|
+
maxLevel = DiagLogLevel.ALL;
|
|
8184
|
+
}
|
|
8185
|
+
logger = logger || {};
|
|
8186
|
+
function _filterFunc(funcName, theLevel) {
|
|
8187
|
+
var theFunc = logger[funcName];
|
|
8188
|
+
if (typeof theFunc === "function" && maxLevel >= theLevel) {
|
|
8189
|
+
return theFunc.bind(logger);
|
|
8190
|
+
}
|
|
8191
|
+
return function() {
|
|
8192
|
+
};
|
|
8193
|
+
}
|
|
8194
|
+
return {
|
|
8195
|
+
error: _filterFunc("error", DiagLogLevel.ERROR),
|
|
8196
|
+
warn: _filterFunc("warn", DiagLogLevel.WARN),
|
|
8197
|
+
info: _filterFunc("info", DiagLogLevel.INFO),
|
|
8198
|
+
debug: _filterFunc("debug", DiagLogLevel.DEBUG),
|
|
8199
|
+
verbose: _filterFunc("verbose", DiagLogLevel.VERBOSE)
|
|
8200
|
+
};
|
|
8201
|
+
}
|
|
8202
|
+
var __read$2 = function(o, n) {
|
|
8203
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
8204
|
+
if (!m) return o;
|
|
8205
|
+
var i = m.call(o), r2, ar = [], e;
|
|
8206
|
+
try {
|
|
8207
|
+
while ((n === void 0 || n-- > 0) && !(r2 = i.next()).done) ar.push(r2.value);
|
|
8208
|
+
} catch (error) {
|
|
8209
|
+
e = { error };
|
|
8210
|
+
} finally {
|
|
8211
|
+
try {
|
|
8212
|
+
if (r2 && !r2.done && (m = i["return"])) m.call(i);
|
|
8213
|
+
} finally {
|
|
8214
|
+
if (e) throw e.error;
|
|
8215
|
+
}
|
|
8216
|
+
}
|
|
8217
|
+
return ar;
|
|
8218
|
+
};
|
|
8219
|
+
var __spreadArray$3 = function(to, from, pack) {
|
|
8220
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
8221
|
+
if (ar || !(i in from)) {
|
|
8222
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
8223
|
+
ar[i] = from[i];
|
|
8224
|
+
}
|
|
8225
|
+
}
|
|
8226
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
8227
|
+
};
|
|
8228
|
+
var API_NAME$2 = "diag";
|
|
8229
|
+
var DiagAPI = (
|
|
8230
|
+
/** @class */
|
|
8231
|
+
(function() {
|
|
8232
|
+
function DiagAPI2() {
|
|
8233
|
+
function _logProxy(funcName) {
|
|
8234
|
+
return function() {
|
|
8235
|
+
var args = [];
|
|
8236
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
8237
|
+
args[_i] = arguments[_i];
|
|
8238
|
+
}
|
|
8239
|
+
var logger = getGlobal("diag");
|
|
8240
|
+
if (!logger)
|
|
8241
|
+
return;
|
|
8242
|
+
return logger[funcName].apply(logger, __spreadArray$3([], __read$2(args), false));
|
|
8243
|
+
};
|
|
8244
|
+
}
|
|
8245
|
+
var self2 = this;
|
|
8246
|
+
var setLogger = function(logger, optionsOrLogLevel) {
|
|
8247
|
+
var _a, _b, _c;
|
|
8248
|
+
if (optionsOrLogLevel === void 0) {
|
|
8249
|
+
optionsOrLogLevel = { logLevel: DiagLogLevel.INFO };
|
|
8250
|
+
}
|
|
8251
|
+
if (logger === self2) {
|
|
8252
|
+
var err = new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");
|
|
8253
|
+
self2.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message);
|
|
8254
|
+
return false;
|
|
8255
|
+
}
|
|
8256
|
+
if (typeof optionsOrLogLevel === "number") {
|
|
8257
|
+
optionsOrLogLevel = {
|
|
8258
|
+
logLevel: optionsOrLogLevel
|
|
8259
|
+
};
|
|
8260
|
+
}
|
|
8261
|
+
var oldLogger = getGlobal("diag");
|
|
8262
|
+
var newLogger = createLogLevelDiagLogger((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : DiagLogLevel.INFO, logger);
|
|
8263
|
+
if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {
|
|
8264
|
+
var stack = (_c = new Error().stack) !== null && _c !== void 0 ? _c : "<failed to generate stacktrace>";
|
|
8265
|
+
oldLogger.warn("Current logger will be overwritten from " + stack);
|
|
8266
|
+
newLogger.warn("Current logger will overwrite one already registered from " + stack);
|
|
8267
|
+
}
|
|
8268
|
+
return registerGlobal("diag", newLogger, self2, true);
|
|
8269
|
+
};
|
|
8270
|
+
self2.setLogger = setLogger;
|
|
8271
|
+
self2.disable = function() {
|
|
8272
|
+
unregisterGlobal(API_NAME$2, self2);
|
|
8273
|
+
};
|
|
8274
|
+
self2.createComponentLogger = function(options) {
|
|
8275
|
+
return new DiagComponentLogger(options);
|
|
8276
|
+
};
|
|
8277
|
+
self2.verbose = _logProxy("verbose");
|
|
8278
|
+
self2.debug = _logProxy("debug");
|
|
8279
|
+
self2.info = _logProxy("info");
|
|
8280
|
+
self2.warn = _logProxy("warn");
|
|
8281
|
+
self2.error = _logProxy("error");
|
|
8282
|
+
}
|
|
8283
|
+
DiagAPI2.instance = function() {
|
|
8284
|
+
if (!this._instance) {
|
|
8285
|
+
this._instance = new DiagAPI2();
|
|
8286
|
+
}
|
|
8287
|
+
return this._instance;
|
|
8288
|
+
};
|
|
8289
|
+
return DiagAPI2;
|
|
8290
|
+
})()
|
|
8291
|
+
);
|
|
8292
|
+
function createContextKey(description) {
|
|
8293
|
+
return Symbol.for(description);
|
|
8294
|
+
}
|
|
8295
|
+
var BaseContext = (
|
|
8296
|
+
/** @class */
|
|
8297
|
+
/* @__PURE__ */ (function() {
|
|
8298
|
+
function BaseContext2(parentContext) {
|
|
8299
|
+
var self2 = this;
|
|
8300
|
+
self2._currentContext = parentContext ? new Map(parentContext) : /* @__PURE__ */ new Map();
|
|
8301
|
+
self2.getValue = function(key2) {
|
|
8302
|
+
return self2._currentContext.get(key2);
|
|
8303
|
+
};
|
|
8304
|
+
self2.setValue = function(key2, value) {
|
|
8305
|
+
var context2 = new BaseContext2(self2._currentContext);
|
|
8306
|
+
context2._currentContext.set(key2, value);
|
|
8307
|
+
return context2;
|
|
8308
|
+
};
|
|
8309
|
+
self2.deleteValue = function(key2) {
|
|
8310
|
+
var context2 = new BaseContext2(self2._currentContext);
|
|
8311
|
+
context2._currentContext.delete(key2);
|
|
8312
|
+
return context2;
|
|
8313
|
+
};
|
|
8314
|
+
}
|
|
8315
|
+
return BaseContext2;
|
|
8316
|
+
})()
|
|
8317
|
+
);
|
|
8318
|
+
var ROOT_CONTEXT = new BaseContext();
|
|
8319
|
+
var __read$1 = function(o, n) {
|
|
8320
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
8321
|
+
if (!m) return o;
|
|
8322
|
+
var i = m.call(o), r2, ar = [], e;
|
|
8323
|
+
try {
|
|
8324
|
+
while ((n === void 0 || n-- > 0) && !(r2 = i.next()).done) ar.push(r2.value);
|
|
8325
|
+
} catch (error) {
|
|
8326
|
+
e = { error };
|
|
8327
|
+
} finally {
|
|
8328
|
+
try {
|
|
8329
|
+
if (r2 && !r2.done && (m = i["return"])) m.call(i);
|
|
8330
|
+
} finally {
|
|
8331
|
+
if (e) throw e.error;
|
|
8332
|
+
}
|
|
8333
|
+
}
|
|
8334
|
+
return ar;
|
|
8335
|
+
};
|
|
8336
|
+
var __spreadArray$2 = function(to, from, pack) {
|
|
8337
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
8338
|
+
if (ar || !(i in from)) {
|
|
8339
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
8340
|
+
ar[i] = from[i];
|
|
8341
|
+
}
|
|
8342
|
+
}
|
|
8343
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
8344
|
+
};
|
|
8345
|
+
var NoopContextManager = (
|
|
8346
|
+
/** @class */
|
|
8347
|
+
(function() {
|
|
8348
|
+
function NoopContextManager2() {
|
|
8349
|
+
}
|
|
8350
|
+
NoopContextManager2.prototype.active = function() {
|
|
8351
|
+
return ROOT_CONTEXT;
|
|
8352
|
+
};
|
|
8353
|
+
NoopContextManager2.prototype.with = function(_context, fn, thisArg) {
|
|
8354
|
+
var args = [];
|
|
8355
|
+
for (var _i = 3; _i < arguments.length; _i++) {
|
|
8356
|
+
args[_i - 3] = arguments[_i];
|
|
8357
|
+
}
|
|
8358
|
+
return fn.call.apply(fn, __spreadArray$2([thisArg], __read$1(args), false));
|
|
8359
|
+
};
|
|
8360
|
+
NoopContextManager2.prototype.bind = function(_context, target) {
|
|
8361
|
+
return target;
|
|
8362
|
+
};
|
|
8363
|
+
NoopContextManager2.prototype.enable = function() {
|
|
8364
|
+
return this;
|
|
8365
|
+
};
|
|
8366
|
+
NoopContextManager2.prototype.disable = function() {
|
|
8367
|
+
return this;
|
|
8368
|
+
};
|
|
8369
|
+
return NoopContextManager2;
|
|
8370
|
+
})()
|
|
8371
|
+
);
|
|
8372
|
+
var __read = function(o, n) {
|
|
8373
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
8374
|
+
if (!m) return o;
|
|
8375
|
+
var i = m.call(o), r2, ar = [], e;
|
|
8376
|
+
try {
|
|
8377
|
+
while ((n === void 0 || n-- > 0) && !(r2 = i.next()).done) ar.push(r2.value);
|
|
8378
|
+
} catch (error) {
|
|
8379
|
+
e = { error };
|
|
8380
|
+
} finally {
|
|
8381
|
+
try {
|
|
8382
|
+
if (r2 && !r2.done && (m = i["return"])) m.call(i);
|
|
8383
|
+
} finally {
|
|
8384
|
+
if (e) throw e.error;
|
|
8385
|
+
}
|
|
8386
|
+
}
|
|
8387
|
+
return ar;
|
|
8388
|
+
};
|
|
8389
|
+
var __spreadArray$1 = function(to, from, pack) {
|
|
8390
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
8391
|
+
if (ar || !(i in from)) {
|
|
8392
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
8393
|
+
ar[i] = from[i];
|
|
8394
|
+
}
|
|
8395
|
+
}
|
|
8396
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
8397
|
+
};
|
|
8398
|
+
var API_NAME$1 = "context";
|
|
8399
|
+
var NOOP_CONTEXT_MANAGER = new NoopContextManager();
|
|
8400
|
+
var ContextAPI = (
|
|
8401
|
+
/** @class */
|
|
8402
|
+
(function() {
|
|
8403
|
+
function ContextAPI2() {
|
|
8404
|
+
}
|
|
8405
|
+
ContextAPI2.getInstance = function() {
|
|
8406
|
+
if (!this._instance) {
|
|
8407
|
+
this._instance = new ContextAPI2();
|
|
8408
|
+
}
|
|
8409
|
+
return this._instance;
|
|
8410
|
+
};
|
|
8411
|
+
ContextAPI2.prototype.setGlobalContextManager = function(contextManager) {
|
|
8412
|
+
return registerGlobal(API_NAME$1, contextManager, DiagAPI.instance());
|
|
8413
|
+
};
|
|
8414
|
+
ContextAPI2.prototype.active = function() {
|
|
8415
|
+
return this._getContextManager().active();
|
|
8416
|
+
};
|
|
8417
|
+
ContextAPI2.prototype.with = function(context2, fn, thisArg) {
|
|
8418
|
+
var _a;
|
|
8419
|
+
var args = [];
|
|
8420
|
+
for (var _i = 3; _i < arguments.length; _i++) {
|
|
8421
|
+
args[_i - 3] = arguments[_i];
|
|
8422
|
+
}
|
|
8423
|
+
return (_a = this._getContextManager()).with.apply(_a, __spreadArray$1([context2, fn, thisArg], __read(args), false));
|
|
8424
|
+
};
|
|
8425
|
+
ContextAPI2.prototype.bind = function(context2, target) {
|
|
8426
|
+
return this._getContextManager().bind(context2, target);
|
|
8427
|
+
};
|
|
8428
|
+
ContextAPI2.prototype._getContextManager = function() {
|
|
8429
|
+
return getGlobal(API_NAME$1) || NOOP_CONTEXT_MANAGER;
|
|
8430
|
+
};
|
|
8431
|
+
ContextAPI2.prototype.disable = function() {
|
|
8432
|
+
this._getContextManager().disable();
|
|
8433
|
+
unregisterGlobal(API_NAME$1, DiagAPI.instance());
|
|
8434
|
+
};
|
|
8435
|
+
return ContextAPI2;
|
|
8436
|
+
})()
|
|
8437
|
+
);
|
|
8438
|
+
var TraceFlags;
|
|
8439
|
+
(function(TraceFlags2) {
|
|
8440
|
+
TraceFlags2[TraceFlags2["NONE"] = 0] = "NONE";
|
|
8441
|
+
TraceFlags2[TraceFlags2["SAMPLED"] = 1] = "SAMPLED";
|
|
8442
|
+
})(TraceFlags || (TraceFlags = {}));
|
|
8443
|
+
var INVALID_SPANID = "0000000000000000";
|
|
8444
|
+
var INVALID_TRACEID = "00000000000000000000000000000000";
|
|
8445
|
+
var INVALID_SPAN_CONTEXT = {
|
|
8446
|
+
traceId: INVALID_TRACEID,
|
|
8447
|
+
spanId: INVALID_SPANID,
|
|
8448
|
+
traceFlags: TraceFlags.NONE
|
|
8449
|
+
};
|
|
8450
|
+
var NonRecordingSpan = (
|
|
8451
|
+
/** @class */
|
|
8452
|
+
(function() {
|
|
8453
|
+
function NonRecordingSpan2(_spanContext) {
|
|
8454
|
+
if (_spanContext === void 0) {
|
|
8455
|
+
_spanContext = INVALID_SPAN_CONTEXT;
|
|
8456
|
+
}
|
|
8457
|
+
this._spanContext = _spanContext;
|
|
8458
|
+
}
|
|
8459
|
+
NonRecordingSpan2.prototype.spanContext = function() {
|
|
8460
|
+
return this._spanContext;
|
|
8461
|
+
};
|
|
8462
|
+
NonRecordingSpan2.prototype.setAttribute = function(_key, _value) {
|
|
8463
|
+
return this;
|
|
8464
|
+
};
|
|
8465
|
+
NonRecordingSpan2.prototype.setAttributes = function(_attributes) {
|
|
8466
|
+
return this;
|
|
8467
|
+
};
|
|
8468
|
+
NonRecordingSpan2.prototype.addEvent = function(_name, _attributes) {
|
|
8469
|
+
return this;
|
|
8470
|
+
};
|
|
8471
|
+
NonRecordingSpan2.prototype.addLink = function(_link) {
|
|
8472
|
+
return this;
|
|
8473
|
+
};
|
|
8474
|
+
NonRecordingSpan2.prototype.addLinks = function(_links) {
|
|
8475
|
+
return this;
|
|
8476
|
+
};
|
|
8477
|
+
NonRecordingSpan2.prototype.setStatus = function(_status) {
|
|
8478
|
+
return this;
|
|
8479
|
+
};
|
|
8480
|
+
NonRecordingSpan2.prototype.updateName = function(_name) {
|
|
8481
|
+
return this;
|
|
8482
|
+
};
|
|
8483
|
+
NonRecordingSpan2.prototype.end = function(_endTime) {
|
|
8484
|
+
};
|
|
8485
|
+
NonRecordingSpan2.prototype.isRecording = function() {
|
|
8486
|
+
return false;
|
|
8487
|
+
};
|
|
8488
|
+
NonRecordingSpan2.prototype.recordException = function(_exception, _time) {
|
|
8489
|
+
};
|
|
8490
|
+
return NonRecordingSpan2;
|
|
8491
|
+
})()
|
|
8492
|
+
);
|
|
8493
|
+
var SPAN_KEY = createContextKey("OpenTelemetry Context Key SPAN");
|
|
8494
|
+
function getSpan(context2) {
|
|
8495
|
+
return context2.getValue(SPAN_KEY) || void 0;
|
|
8496
|
+
}
|
|
8497
|
+
function getActiveSpan$1() {
|
|
8498
|
+
return getSpan(ContextAPI.getInstance().active());
|
|
8499
|
+
}
|
|
8500
|
+
function setSpan(context2, span) {
|
|
8501
|
+
return context2.setValue(SPAN_KEY, span);
|
|
8502
|
+
}
|
|
8503
|
+
function deleteSpan(context2) {
|
|
8504
|
+
return context2.deleteValue(SPAN_KEY);
|
|
8505
|
+
}
|
|
8506
|
+
function setSpanContext(context2, spanContext) {
|
|
8507
|
+
return setSpan(context2, new NonRecordingSpan(spanContext));
|
|
8508
|
+
}
|
|
8509
|
+
function getSpanContext(context2) {
|
|
8510
|
+
var _a;
|
|
8511
|
+
return (_a = getSpan(context2)) === null || _a === void 0 ? void 0 : _a.spanContext();
|
|
8512
|
+
}
|
|
8513
|
+
var VALID_TRACEID_REGEX = /^([0-9a-f]{32})$/i;
|
|
8514
|
+
var VALID_SPANID_REGEX = /^[0-9a-f]{16}$/i;
|
|
8515
|
+
function isValidTraceId(traceId) {
|
|
8516
|
+
return VALID_TRACEID_REGEX.test(traceId) && traceId !== INVALID_TRACEID;
|
|
8517
|
+
}
|
|
8518
|
+
function isValidSpanId(spanId) {
|
|
8519
|
+
return VALID_SPANID_REGEX.test(spanId) && spanId !== INVALID_SPANID;
|
|
8520
|
+
}
|
|
8521
|
+
function isSpanContextValid(spanContext) {
|
|
8522
|
+
return isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId);
|
|
8523
|
+
}
|
|
8524
|
+
function wrapSpanContext(spanContext) {
|
|
8525
|
+
return new NonRecordingSpan(spanContext);
|
|
8526
|
+
}
|
|
8527
|
+
var contextApi = ContextAPI.getInstance();
|
|
8528
|
+
var NoopTracer = (
|
|
8529
|
+
/** @class */
|
|
8530
|
+
(function() {
|
|
8531
|
+
function NoopTracer2() {
|
|
8532
|
+
}
|
|
8533
|
+
NoopTracer2.prototype.startSpan = function(name2, options, context2) {
|
|
8534
|
+
if (context2 === void 0) {
|
|
8535
|
+
context2 = contextApi.active();
|
|
8536
|
+
}
|
|
8537
|
+
var root2 = Boolean(options === null || options === void 0 ? void 0 : options.root);
|
|
8538
|
+
if (root2) {
|
|
8539
|
+
return new NonRecordingSpan();
|
|
8540
|
+
}
|
|
8541
|
+
var parentFromContext = context2 && getSpanContext(context2);
|
|
8542
|
+
if (isSpanContext(parentFromContext) && isSpanContextValid(parentFromContext)) {
|
|
8543
|
+
return new NonRecordingSpan(parentFromContext);
|
|
8544
|
+
} else {
|
|
8545
|
+
return new NonRecordingSpan();
|
|
8546
|
+
}
|
|
8547
|
+
};
|
|
8548
|
+
NoopTracer2.prototype.startActiveSpan = function(name2, arg2, arg3, arg4) {
|
|
8549
|
+
var opts;
|
|
8550
|
+
var ctx;
|
|
8551
|
+
var fn;
|
|
8552
|
+
if (arguments.length < 2) {
|
|
8553
|
+
return;
|
|
8554
|
+
} else if (arguments.length === 2) {
|
|
8555
|
+
fn = arg2;
|
|
8556
|
+
} else if (arguments.length === 3) {
|
|
8557
|
+
opts = arg2;
|
|
8558
|
+
fn = arg3;
|
|
8559
|
+
} else {
|
|
8560
|
+
opts = arg2;
|
|
8561
|
+
ctx = arg3;
|
|
8562
|
+
fn = arg4;
|
|
8563
|
+
}
|
|
8564
|
+
var parentContext = ctx !== null && ctx !== void 0 ? ctx : contextApi.active();
|
|
8565
|
+
var span = this.startSpan(name2, opts, parentContext);
|
|
8566
|
+
var contextWithSpanSet = setSpan(parentContext, span);
|
|
8567
|
+
return contextApi.with(contextWithSpanSet, fn, void 0, span);
|
|
8568
|
+
};
|
|
8569
|
+
return NoopTracer2;
|
|
8570
|
+
})()
|
|
8571
|
+
);
|
|
8572
|
+
function isSpanContext(spanContext) {
|
|
8573
|
+
return typeof spanContext === "object" && typeof spanContext["spanId"] === "string" && typeof spanContext["traceId"] === "string" && typeof spanContext["traceFlags"] === "number";
|
|
8574
|
+
}
|
|
8575
|
+
var NOOP_TRACER = new NoopTracer();
|
|
8576
|
+
var ProxyTracer = (
|
|
8577
|
+
/** @class */
|
|
8578
|
+
(function() {
|
|
8579
|
+
function ProxyTracer2(_provider, name2, version, options) {
|
|
8580
|
+
this._provider = _provider;
|
|
8581
|
+
this.name = name2;
|
|
8582
|
+
this.version = version;
|
|
8583
|
+
this.options = options;
|
|
8584
|
+
}
|
|
8585
|
+
ProxyTracer2.prototype.startSpan = function(name2, options, context2) {
|
|
8586
|
+
return this._getTracer().startSpan(name2, options, context2);
|
|
8587
|
+
};
|
|
8588
|
+
ProxyTracer2.prototype.startActiveSpan = function(_name, _options, _context, _fn) {
|
|
8589
|
+
var tracer = this._getTracer();
|
|
8590
|
+
return Reflect.apply(tracer.startActiveSpan, tracer, arguments);
|
|
8591
|
+
};
|
|
8592
|
+
ProxyTracer2.prototype._getTracer = function() {
|
|
8593
|
+
if (this._delegate) {
|
|
8594
|
+
return this._delegate;
|
|
8595
|
+
}
|
|
8596
|
+
var tracer = this._provider.getDelegateTracer(this.name, this.version, this.options);
|
|
8597
|
+
if (!tracer) {
|
|
8598
|
+
return NOOP_TRACER;
|
|
8599
|
+
}
|
|
8600
|
+
this._delegate = tracer;
|
|
8601
|
+
return this._delegate;
|
|
8602
|
+
};
|
|
8603
|
+
return ProxyTracer2;
|
|
8604
|
+
})()
|
|
8605
|
+
);
|
|
8606
|
+
var NoopTracerProvider = (
|
|
8607
|
+
/** @class */
|
|
8608
|
+
(function() {
|
|
8609
|
+
function NoopTracerProvider2() {
|
|
8610
|
+
}
|
|
8611
|
+
NoopTracerProvider2.prototype.getTracer = function(_name, _version, _options) {
|
|
8612
|
+
return new NoopTracer();
|
|
8613
|
+
};
|
|
8614
|
+
return NoopTracerProvider2;
|
|
8615
|
+
})()
|
|
8616
|
+
);
|
|
8617
|
+
var NOOP_TRACER_PROVIDER = new NoopTracerProvider();
|
|
8618
|
+
var ProxyTracerProvider = (
|
|
8619
|
+
/** @class */
|
|
8620
|
+
(function() {
|
|
8621
|
+
function ProxyTracerProvider2() {
|
|
8622
|
+
}
|
|
8623
|
+
ProxyTracerProvider2.prototype.getTracer = function(name2, version, options) {
|
|
8624
|
+
var _a;
|
|
8625
|
+
return (_a = this.getDelegateTracer(name2, version, options)) !== null && _a !== void 0 ? _a : new ProxyTracer(this, name2, version, options);
|
|
8626
|
+
};
|
|
8627
|
+
ProxyTracerProvider2.prototype.getDelegate = function() {
|
|
8628
|
+
var _a;
|
|
8629
|
+
return (_a = this._delegate) !== null && _a !== void 0 ? _a : NOOP_TRACER_PROVIDER;
|
|
8630
|
+
};
|
|
8631
|
+
ProxyTracerProvider2.prototype.setDelegate = function(delegate) {
|
|
8632
|
+
this._delegate = delegate;
|
|
8633
|
+
};
|
|
8634
|
+
ProxyTracerProvider2.prototype.getDelegateTracer = function(name2, version, options) {
|
|
8635
|
+
var _a;
|
|
8636
|
+
return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name2, version, options);
|
|
8637
|
+
};
|
|
8638
|
+
return ProxyTracerProvider2;
|
|
8639
|
+
})()
|
|
8640
|
+
);
|
|
8641
|
+
var SpanStatusCode;
|
|
8642
|
+
(function(SpanStatusCode2) {
|
|
8643
|
+
SpanStatusCode2[SpanStatusCode2["UNSET"] = 0] = "UNSET";
|
|
8644
|
+
SpanStatusCode2[SpanStatusCode2["OK"] = 1] = "OK";
|
|
8645
|
+
SpanStatusCode2[SpanStatusCode2["ERROR"] = 2] = "ERROR";
|
|
8646
|
+
})(SpanStatusCode || (SpanStatusCode = {}));
|
|
8647
|
+
var context = ContextAPI.getInstance();
|
|
8648
|
+
var API_NAME = "trace";
|
|
8649
|
+
var TraceAPI = (
|
|
8650
|
+
/** @class */
|
|
8651
|
+
(function() {
|
|
8652
|
+
function TraceAPI2() {
|
|
8653
|
+
this._proxyTracerProvider = new ProxyTracerProvider();
|
|
8654
|
+
this.wrapSpanContext = wrapSpanContext;
|
|
8655
|
+
this.isSpanContextValid = isSpanContextValid;
|
|
8656
|
+
this.deleteSpan = deleteSpan;
|
|
8657
|
+
this.getSpan = getSpan;
|
|
8658
|
+
this.getActiveSpan = getActiveSpan$1;
|
|
8659
|
+
this.getSpanContext = getSpanContext;
|
|
8660
|
+
this.setSpan = setSpan;
|
|
8661
|
+
this.setSpanContext = setSpanContext;
|
|
8662
|
+
}
|
|
8663
|
+
TraceAPI2.getInstance = function() {
|
|
8664
|
+
if (!this._instance) {
|
|
8665
|
+
this._instance = new TraceAPI2();
|
|
8666
|
+
}
|
|
8667
|
+
return this._instance;
|
|
8668
|
+
};
|
|
8669
|
+
TraceAPI2.prototype.setGlobalTracerProvider = function(provider) {
|
|
8670
|
+
var success = registerGlobal(API_NAME, this._proxyTracerProvider, DiagAPI.instance());
|
|
8671
|
+
if (success) {
|
|
8672
|
+
this._proxyTracerProvider.setDelegate(provider);
|
|
8673
|
+
}
|
|
8674
|
+
return success;
|
|
8675
|
+
};
|
|
8676
|
+
TraceAPI2.prototype.getTracerProvider = function() {
|
|
8677
|
+
return getGlobal(API_NAME) || this._proxyTracerProvider;
|
|
8678
|
+
};
|
|
8679
|
+
TraceAPI2.prototype.getTracer = function(name2, version) {
|
|
8680
|
+
return this.getTracerProvider().getTracer(name2, version);
|
|
8681
|
+
};
|
|
8682
|
+
TraceAPI2.prototype.disable = function() {
|
|
8683
|
+
unregisterGlobal(API_NAME, DiagAPI.instance());
|
|
8684
|
+
this._proxyTracerProvider = new ProxyTracerProvider();
|
|
8685
|
+
};
|
|
8686
|
+
return TraceAPI2;
|
|
8687
|
+
})()
|
|
8688
|
+
);
|
|
8689
|
+
var trace = TraceAPI.getInstance();
|
|
8690
|
+
const PACKAGE_VERSION = "1.0.41";
|
|
8691
|
+
const TRACER_NAME = "@industry-theme/backlogmd-kanban-panel";
|
|
8692
|
+
const TRACER_VERSION = PACKAGE_VERSION;
|
|
8693
|
+
function getTracer() {
|
|
8694
|
+
return trace.getTracer(TRACER_NAME, TRACER_VERSION);
|
|
8695
|
+
}
|
|
8696
|
+
function getActiveSpan() {
|
|
8697
|
+
return trace.getActiveSpan();
|
|
8698
|
+
}
|
|
8699
|
+
async function withSpan(span, fn) {
|
|
8700
|
+
return context.with(trace.setSpan(context.active(), span), fn);
|
|
8701
|
+
}
|
|
7984
8702
|
const STATUS_COLUMNS = [
|
|
7985
8703
|
DEFAULT_TASK_STATUSES.TODO,
|
|
7986
8704
|
DEFAULT_TASK_STATUSES.IN_PROGRESS,
|
|
@@ -7989,7 +8707,7 @@ const STATUS_COLUMNS = [
|
|
|
7989
8707
|
const DEFAULT_TASKS_LIMIT = 20;
|
|
7990
8708
|
function useKanbanData(options) {
|
|
7991
8709
|
const {
|
|
7992
|
-
context,
|
|
8710
|
+
context: context2,
|
|
7993
8711
|
actions,
|
|
7994
8712
|
tasksLimit = DEFAULT_TASKS_LIMIT,
|
|
7995
8713
|
events: events2
|
|
@@ -8008,12 +8726,12 @@ function useKanbanData(options) {
|
|
|
8008
8726
|
const [isLoadingMore, setIsLoadingMore] = useState(false);
|
|
8009
8727
|
const coreRef = useRef(null);
|
|
8010
8728
|
const activeFilePathRef = useRef(null);
|
|
8011
|
-
const contextRef = useRef(
|
|
8729
|
+
const contextRef = useRef(context2);
|
|
8012
8730
|
const actionsRef = useRef(actions);
|
|
8013
8731
|
useEffect(() => {
|
|
8014
|
-
contextRef.current =
|
|
8732
|
+
contextRef.current = context2;
|
|
8015
8733
|
actionsRef.current = actions;
|
|
8016
|
-
}, [
|
|
8734
|
+
}, [context2, actions]);
|
|
8017
8735
|
const fetchFileContent = useCallback(async (path2) => {
|
|
8018
8736
|
var _a;
|
|
8019
8737
|
const currentContext = contextRef.current;
|
|
@@ -8049,8 +8767,12 @@ function useKanbanData(options) {
|
|
|
8049
8767
|
return newColumnStates;
|
|
8050
8768
|
}, []);
|
|
8051
8769
|
const loadBacklogData = useCallback(async () => {
|
|
8052
|
-
var _a, _b
|
|
8053
|
-
|
|
8770
|
+
var _a, _b;
|
|
8771
|
+
const tracer = getTracer();
|
|
8772
|
+
const span = tracer.startSpan("kanban.load");
|
|
8773
|
+
const startTime = Date.now();
|
|
8774
|
+
span.addEvent("kanban.loading");
|
|
8775
|
+
if (!context2 || !actions) {
|
|
8054
8776
|
console.log("[useKanbanData] No context provided");
|
|
8055
8777
|
setIsBacklogProject(false);
|
|
8056
8778
|
setTasks([]);
|
|
@@ -8058,9 +8780,12 @@ function useKanbanData(options) {
|
|
|
8058
8780
|
setIsLoading(false);
|
|
8059
8781
|
coreRef.current = null;
|
|
8060
8782
|
fileTreeVersionRef.current = null;
|
|
8783
|
+
span.setAttributes({ "output.skipped": true, "output.reason": "no_context" });
|
|
8784
|
+
span.setStatus({ code: SpanStatusCode.OK });
|
|
8785
|
+
span.end();
|
|
8061
8786
|
return;
|
|
8062
8787
|
}
|
|
8063
|
-
const fileTreeSlice =
|
|
8788
|
+
const fileTreeSlice = context2.fileTree;
|
|
8064
8789
|
if (!((_a = fileTreeSlice == null ? void 0 : fileTreeSlice.data) == null ? void 0 : _a.allFiles)) {
|
|
8065
8790
|
console.log("[useKanbanData] FileTree not available");
|
|
8066
8791
|
setIsBacklogProject(false);
|
|
@@ -8068,79 +8793,115 @@ function useKanbanData(options) {
|
|
|
8068
8793
|
setColumnStates(/* @__PURE__ */ new Map());
|
|
8069
8794
|
coreRef.current = null;
|
|
8070
8795
|
fileTreeVersionRef.current = null;
|
|
8796
|
+
span.setAttributes({ "output.skipped": true, "output.reason": "no_filetree" });
|
|
8797
|
+
span.setStatus({ code: SpanStatusCode.OK });
|
|
8798
|
+
span.end();
|
|
8071
8799
|
return;
|
|
8072
8800
|
}
|
|
8073
8801
|
const currentVersion = fileTreeSlice.data.sha || ((_b = fileTreeSlice.data.metadata) == null ? void 0 : _b.sourceSha) || "unknown";
|
|
8074
8802
|
if (coreRef.current && fileTreeVersionRef.current === currentVersion) {
|
|
8075
8803
|
console.log("[useKanbanData] Data already loaded for this file tree version, skipping");
|
|
8076
8804
|
setIsLoading(false);
|
|
8805
|
+
span.setAttributes({ "output.skipped": true, "output.reason": "already_loaded" });
|
|
8806
|
+
span.setStatus({ code: SpanStatusCode.OK });
|
|
8807
|
+
span.end();
|
|
8077
8808
|
return;
|
|
8078
8809
|
}
|
|
8079
8810
|
setIsLoading(true);
|
|
8080
8811
|
setError(null);
|
|
8081
|
-
|
|
8082
|
-
|
|
8083
|
-
|
|
8084
|
-
|
|
8085
|
-
|
|
8086
|
-
|
|
8087
|
-
|
|
8088
|
-
|
|
8089
|
-
|
|
8090
|
-
|
|
8091
|
-
|
|
8092
|
-
|
|
8093
|
-
|
|
8094
|
-
|
|
8095
|
-
|
|
8812
|
+
const files = fileTreeSlice.data.allFiles;
|
|
8813
|
+
const filePaths = files.map((f) => f.path);
|
|
8814
|
+
return withSpan(span, async () => {
|
|
8815
|
+
var _a2;
|
|
8816
|
+
try {
|
|
8817
|
+
const fs = new PanelFileSystemAdapter({
|
|
8818
|
+
fetchFile: fetchFileContent,
|
|
8819
|
+
filePaths,
|
|
8820
|
+
hostFileSystem: (_a2 = context2.adapters) == null ? void 0 : _a2.fileSystem
|
|
8821
|
+
});
|
|
8822
|
+
const core2 = new Core({
|
|
8823
|
+
projectRoot: "",
|
|
8824
|
+
adapters: { fs }
|
|
8825
|
+
});
|
|
8826
|
+
const isProject = await core2.isBacklogProject();
|
|
8827
|
+
if (!isProject) {
|
|
8828
|
+
console.log("[useKanbanData] Not a Backlog.md project");
|
|
8829
|
+
setIsBacklogProject(false);
|
|
8830
|
+
setTasks([]);
|
|
8831
|
+
setColumnStates(/* @__PURE__ */ new Map());
|
|
8832
|
+
coreRef.current = null;
|
|
8833
|
+
span.setAttributes({
|
|
8834
|
+
"output.isBacklogProject": false,
|
|
8835
|
+
"duration.ms": Date.now() - startTime
|
|
8836
|
+
});
|
|
8837
|
+
span.addEvent("kanban.loaded", { "tasks.count": 0, "is.backlog.project": false });
|
|
8838
|
+
span.setStatus({ code: SpanStatusCode.OK });
|
|
8839
|
+
return;
|
|
8840
|
+
}
|
|
8841
|
+
console.log("[useKanbanData] Loading Backlog.md data with lazy loading...");
|
|
8842
|
+
setIsBacklogProject(true);
|
|
8843
|
+
setCanWrite(fs.canWrite);
|
|
8844
|
+
await core2.initializeLazy(filePaths);
|
|
8845
|
+
coreRef.current = core2;
|
|
8846
|
+
const paginatedResult = await core2.loadMoreForSource("tasks", 0, {
|
|
8847
|
+
limit: tasksLimit,
|
|
8848
|
+
sortDirection: "asc"
|
|
8849
|
+
});
|
|
8850
|
+
const allTasks = paginatedResult.items;
|
|
8851
|
+
const total = paginatedResult.total;
|
|
8852
|
+
console.log(
|
|
8853
|
+
`[useKanbanData] Loaded ${allTasks.length}/${total} tasks`
|
|
8854
|
+
);
|
|
8855
|
+
if (allTasks.length > 0) {
|
|
8856
|
+
console.log("[useKanbanData] First task sample:", {
|
|
8857
|
+
id: allTasks[0].id,
|
|
8858
|
+
title: allTasks[0].title,
|
|
8859
|
+
status: allTasks[0].status,
|
|
8860
|
+
description: allTasks[0].description,
|
|
8861
|
+
filePath: allTasks[0].filePath
|
|
8862
|
+
});
|
|
8863
|
+
}
|
|
8864
|
+
fileTreeVersionRef.current = currentVersion;
|
|
8865
|
+
const newColumnStates = buildColumnStates(allTasks);
|
|
8866
|
+
setTasks(allTasks);
|
|
8867
|
+
setColumnStates(newColumnStates);
|
|
8868
|
+
setTotalLoaded(allTasks.length);
|
|
8869
|
+
setTotalCount(total);
|
|
8870
|
+
setHasMore(paginatedResult.hasMore);
|
|
8871
|
+
span.addEvent("kanban.loaded", {
|
|
8872
|
+
"tasks.count": allTasks.length,
|
|
8873
|
+
"tasks.total": total,
|
|
8874
|
+
"tasks.hasMore": paginatedResult.hasMore
|
|
8875
|
+
});
|
|
8876
|
+
span.setAttributes({
|
|
8877
|
+
"output.isBacklogProject": true,
|
|
8878
|
+
"output.tasksLoaded": allTasks.length,
|
|
8879
|
+
"output.tasksTotal": total,
|
|
8880
|
+
"output.hasMore": paginatedResult.hasMore,
|
|
8881
|
+
"duration.ms": Date.now() - startTime
|
|
8882
|
+
});
|
|
8883
|
+
span.setStatus({ code: SpanStatusCode.OK });
|
|
8884
|
+
} catch (err) {
|
|
8885
|
+
console.error("[useKanbanData] Failed to load Backlog.md data:", err);
|
|
8886
|
+
const errorMessage = err instanceof Error ? err.message : "Failed to load backlog data";
|
|
8887
|
+
setError(errorMessage);
|
|
8096
8888
|
setIsBacklogProject(false);
|
|
8097
8889
|
setTasks([]);
|
|
8098
8890
|
setColumnStates(/* @__PURE__ */ new Map());
|
|
8099
8891
|
coreRef.current = null;
|
|
8100
|
-
|
|
8101
|
-
|
|
8102
|
-
|
|
8103
|
-
|
|
8104
|
-
setCanWrite(fs.canWrite);
|
|
8105
|
-
await core2.initializeLazy(filePaths);
|
|
8106
|
-
coreRef.current = core2;
|
|
8107
|
-
const paginatedResult = await core2.loadMoreForSource("tasks", 0, {
|
|
8108
|
-
limit: tasksLimit,
|
|
8109
|
-
sortDirection: "asc"
|
|
8110
|
-
});
|
|
8111
|
-
const allTasks = paginatedResult.items;
|
|
8112
|
-
const total = paginatedResult.total;
|
|
8113
|
-
console.log(
|
|
8114
|
-
`[useKanbanData] Loaded ${allTasks.length}/${total} tasks`
|
|
8115
|
-
);
|
|
8116
|
-
if (allTasks.length > 0) {
|
|
8117
|
-
console.log("[useKanbanData] First task sample:", {
|
|
8118
|
-
id: allTasks[0].id,
|
|
8119
|
-
title: allTasks[0].title,
|
|
8120
|
-
status: allTasks[0].status,
|
|
8121
|
-
description: allTasks[0].description,
|
|
8122
|
-
filePath: allTasks[0].filePath
|
|
8892
|
+
fileTreeVersionRef.current = null;
|
|
8893
|
+
span.addEvent("kanban.load.error", {
|
|
8894
|
+
"error.type": err instanceof Error ? err.name : "Unknown",
|
|
8895
|
+
"error.message": errorMessage
|
|
8123
8896
|
});
|
|
8897
|
+
span.recordException(err);
|
|
8898
|
+
span.setStatus({ code: SpanStatusCode.ERROR, message: errorMessage });
|
|
8899
|
+
} finally {
|
|
8900
|
+
setIsLoading(false);
|
|
8901
|
+
span.end();
|
|
8124
8902
|
}
|
|
8125
|
-
|
|
8126
|
-
|
|
8127
|
-
setTasks(allTasks);
|
|
8128
|
-
setColumnStates(newColumnStates);
|
|
8129
|
-
setTotalLoaded(allTasks.length);
|
|
8130
|
-
setTotalCount(total);
|
|
8131
|
-
setHasMore(paginatedResult.hasMore);
|
|
8132
|
-
} catch (err) {
|
|
8133
|
-
console.error("[useKanbanData] Failed to load Backlog.md data:", err);
|
|
8134
|
-
setError(err instanceof Error ? err.message : "Failed to load backlog data");
|
|
8135
|
-
setIsBacklogProject(false);
|
|
8136
|
-
setTasks([]);
|
|
8137
|
-
setColumnStates(/* @__PURE__ */ new Map());
|
|
8138
|
-
coreRef.current = null;
|
|
8139
|
-
fileTreeVersionRef.current = null;
|
|
8140
|
-
} finally {
|
|
8141
|
-
setIsLoading(false);
|
|
8142
|
-
}
|
|
8143
|
-
}, [context, actions, fetchFileContent, tasksLimit, buildColumnStates]);
|
|
8903
|
+
});
|
|
8904
|
+
}, [context2, actions, fetchFileContent, tasksLimit, buildColumnStates]);
|
|
8144
8905
|
useEffect(() => {
|
|
8145
8906
|
loadBacklogData();
|
|
8146
8907
|
}, [loadBacklogData]);
|
|
@@ -8166,28 +8927,61 @@ function useKanbanData(options) {
|
|
|
8166
8927
|
if (!hasMore || isLoadingMore) {
|
|
8167
8928
|
return;
|
|
8168
8929
|
}
|
|
8930
|
+
const tracer = getTracer();
|
|
8931
|
+
const span = tracer.startSpan("kanban.load.more", {
|
|
8932
|
+
attributes: {
|
|
8933
|
+
"input.offset": totalLoaded,
|
|
8934
|
+
"input.limit": tasksLimit
|
|
8935
|
+
}
|
|
8936
|
+
});
|
|
8937
|
+
const startTime = Date.now();
|
|
8169
8938
|
setIsLoadingMore(true);
|
|
8170
|
-
|
|
8171
|
-
|
|
8172
|
-
|
|
8173
|
-
|
|
8174
|
-
|
|
8175
|
-
|
|
8176
|
-
|
|
8177
|
-
|
|
8178
|
-
|
|
8179
|
-
|
|
8180
|
-
|
|
8181
|
-
|
|
8182
|
-
|
|
8183
|
-
|
|
8184
|
-
|
|
8185
|
-
|
|
8186
|
-
|
|
8187
|
-
|
|
8188
|
-
|
|
8189
|
-
|
|
8190
|
-
|
|
8939
|
+
return withSpan(span, async () => {
|
|
8940
|
+
try {
|
|
8941
|
+
span.addEvent("kanban.load.more", {
|
|
8942
|
+
offset: totalLoaded,
|
|
8943
|
+
limit: tasksLimit
|
|
8944
|
+
});
|
|
8945
|
+
const result = await core2.loadMoreForSource("tasks", totalLoaded, {
|
|
8946
|
+
limit: tasksLimit,
|
|
8947
|
+
sortDirection: "asc"
|
|
8948
|
+
});
|
|
8949
|
+
console.log(
|
|
8950
|
+
`[useKanbanData] Loaded ${result.items.length} more tasks (${totalLoaded + result.items.length}/${result.total})`
|
|
8951
|
+
);
|
|
8952
|
+
const newTasks = [...tasks, ...result.items];
|
|
8953
|
+
setTasks(newTasks);
|
|
8954
|
+
setTotalLoaded(newTasks.length);
|
|
8955
|
+
setTotalCount(result.total);
|
|
8956
|
+
setHasMore(result.hasMore);
|
|
8957
|
+
const newColumnStates = buildColumnStates(newTasks);
|
|
8958
|
+
setColumnStates(newColumnStates);
|
|
8959
|
+
span.addEvent("kanban.loaded", {
|
|
8960
|
+
"tasks.count": newTasks.length,
|
|
8961
|
+
"tasks.newlyLoaded": result.items.length
|
|
8962
|
+
});
|
|
8963
|
+
span.setAttributes({
|
|
8964
|
+
"output.tasksLoaded": result.items.length,
|
|
8965
|
+
"output.totalTasks": newTasks.length,
|
|
8966
|
+
"output.hasMore": result.hasMore,
|
|
8967
|
+
"duration.ms": Date.now() - startTime
|
|
8968
|
+
});
|
|
8969
|
+
span.setStatus({ code: SpanStatusCode.OK });
|
|
8970
|
+
} catch (err) {
|
|
8971
|
+
console.error("[useKanbanData] Failed to load more tasks:", err);
|
|
8972
|
+
const errorMessage = err instanceof Error ? err.message : "Failed to load more tasks";
|
|
8973
|
+
setError(errorMessage);
|
|
8974
|
+
span.addEvent("kanban.load.error", {
|
|
8975
|
+
"error.type": err instanceof Error ? err.name : "Unknown",
|
|
8976
|
+
"error.message": errorMessage
|
|
8977
|
+
});
|
|
8978
|
+
span.recordException(err);
|
|
8979
|
+
span.setStatus({ code: SpanStatusCode.ERROR, message: errorMessage });
|
|
8980
|
+
} finally {
|
|
8981
|
+
setIsLoadingMore(false);
|
|
8982
|
+
span.end();
|
|
8983
|
+
}
|
|
8984
|
+
});
|
|
8191
8985
|
}, [tasks, hasMore, isLoadingMore, totalLoaded, tasksLimit, buildColumnStates]);
|
|
8192
8986
|
const loadMore = useCallback(
|
|
8193
8987
|
async (_status) => {
|
|
@@ -8201,9 +8995,15 @@ function useKanbanData(options) {
|
|
|
8201
8995
|
const updateTaskStatus = useCallback(
|
|
8202
8996
|
async (taskId, newStatus) => {
|
|
8203
8997
|
const core2 = coreRef.current;
|
|
8998
|
+
const activeSpan = getActiveSpan();
|
|
8204
8999
|
if (!core2) {
|
|
8205
9000
|
console.warn("[useKanbanData] Core not available for updateTaskStatus");
|
|
8206
9001
|
setError("Cannot update task - backlog not loaded");
|
|
9002
|
+
activeSpan == null ? void 0 : activeSpan.addEvent("task.save.error", {
|
|
9003
|
+
"error.type": "CoreNotAvailable",
|
|
9004
|
+
"error.message": "Cannot update task - backlog not loaded",
|
|
9005
|
+
"task.id": taskId
|
|
9006
|
+
});
|
|
8207
9007
|
return;
|
|
8208
9008
|
}
|
|
8209
9009
|
setError(null);
|
|
@@ -8214,10 +9014,21 @@ function useKanbanData(options) {
|
|
|
8214
9014
|
throw new Error(`Task ${taskId} not found`);
|
|
8215
9015
|
}
|
|
8216
9016
|
console.log(`[useKanbanData] Task ${taskId} updated successfully`);
|
|
9017
|
+
activeSpan == null ? void 0 : activeSpan.addEvent("task.updated", {
|
|
9018
|
+
"task.id": taskId,
|
|
9019
|
+
"task.status": newStatus,
|
|
9020
|
+
"updated.fields": "status"
|
|
9021
|
+
});
|
|
8217
9022
|
await loadBacklogData();
|
|
8218
9023
|
} catch (err) {
|
|
8219
9024
|
console.error("[useKanbanData] Failed to update task status:", err);
|
|
8220
|
-
|
|
9025
|
+
const errorMessage = err instanceof Error ? err.message : "Failed to update task";
|
|
9026
|
+
setError(errorMessage);
|
|
9027
|
+
activeSpan == null ? void 0 : activeSpan.addEvent("task.save.error", {
|
|
9028
|
+
"error.type": err instanceof Error ? err.name : "Unknown",
|
|
9029
|
+
"error.message": errorMessage,
|
|
9030
|
+
"task.id": taskId
|
|
9031
|
+
});
|
|
8221
9032
|
}
|
|
8222
9033
|
},
|
|
8223
9034
|
[loadBacklogData]
|
|
@@ -8225,13 +9036,21 @@ function useKanbanData(options) {
|
|
|
8225
9036
|
const moveTaskOptimistic = useCallback(
|
|
8226
9037
|
(taskId, toColumn) => {
|
|
8227
9038
|
const newStatus = toColumn;
|
|
9039
|
+
const activeSpan = getActiveSpan();
|
|
8228
9040
|
setTasks((prev) => {
|
|
9041
|
+
const task = prev.find((t) => t.id === taskId);
|
|
9042
|
+
const fromStatus = (task == null ? void 0 : task.status) || "unknown";
|
|
8229
9043
|
const newTasks = prev.map(
|
|
8230
9044
|
(t) => t.id === taskId ? { ...t, status: newStatus } : t
|
|
8231
9045
|
);
|
|
8232
9046
|
const newColumnStates = buildColumnStates(newTasks);
|
|
8233
9047
|
setColumnStates(newColumnStates);
|
|
8234
9048
|
console.log(`[useKanbanData] Moved task ${taskId} to ${toColumn} (${newStatus})`);
|
|
9049
|
+
activeSpan == null ? void 0 : activeSpan.addEvent("task.moved", {
|
|
9050
|
+
"task.id": taskId,
|
|
9051
|
+
"from.status": fromStatus,
|
|
9052
|
+
"to.status": newStatus
|
|
9053
|
+
});
|
|
8235
9054
|
return newTasks;
|
|
8236
9055
|
});
|
|
8237
9056
|
},
|
|
@@ -8411,7 +9230,7 @@ const TaskCard = ({
|
|
|
8411
9230
|
zIndex: 1e3
|
|
8412
9231
|
}
|
|
8413
9232
|
};
|
|
8414
|
-
const handleClick = (
|
|
9233
|
+
const handleClick = (_e2) => {
|
|
8415
9234
|
if (!isDragging && onClick) {
|
|
8416
9235
|
onClick(task);
|
|
8417
9236
|
}
|
|
@@ -9061,6 +9880,20 @@ const BoardEmptyState = ({
|
|
|
9061
9880
|
canWrite
|
|
9062
9881
|
}) => {
|
|
9063
9882
|
const { theme: theme2 } = useTheme();
|
|
9883
|
+
const handleAddTask = useCallback(() => {
|
|
9884
|
+
const activeSpan = getActiveSpan();
|
|
9885
|
+
activeSpan == null ? void 0 : activeSpan.addEvent("empty.action.clicked", {
|
|
9886
|
+
"action.type": "add_task"
|
|
9887
|
+
});
|
|
9888
|
+
onAddTask();
|
|
9889
|
+
}, [onAddTask]);
|
|
9890
|
+
const handleAddMilestone = useCallback(() => {
|
|
9891
|
+
const activeSpan = getActiveSpan();
|
|
9892
|
+
activeSpan == null ? void 0 : activeSpan.addEvent("empty.action.clicked", {
|
|
9893
|
+
"action.type": "add_milestone"
|
|
9894
|
+
});
|
|
9895
|
+
onAddMilestone();
|
|
9896
|
+
}, [onAddMilestone]);
|
|
9064
9897
|
return /* @__PURE__ */ jsxs(
|
|
9065
9898
|
"div",
|
|
9066
9899
|
{
|
|
@@ -9120,7 +9953,7 @@ const BoardEmptyState = ({
|
|
|
9120
9953
|
/* @__PURE__ */ jsxs(
|
|
9121
9954
|
"button",
|
|
9122
9955
|
{
|
|
9123
|
-
onClick:
|
|
9956
|
+
onClick: handleAddTask,
|
|
9124
9957
|
style: {
|
|
9125
9958
|
display: "inline-flex",
|
|
9126
9959
|
alignItems: "center",
|
|
@@ -9150,7 +9983,7 @@ const BoardEmptyState = ({
|
|
|
9150
9983
|
/* @__PURE__ */ jsxs(
|
|
9151
9984
|
"button",
|
|
9152
9985
|
{
|
|
9153
|
-
onClick:
|
|
9986
|
+
onClick: handleAddMilestone,
|
|
9154
9987
|
style: {
|
|
9155
9988
|
display: "inline-flex",
|
|
9156
9989
|
alignItems: "center",
|
|
@@ -9709,7 +10542,7 @@ const TaskModal = ({
|
|
|
9709
10542
|
return createPortal(modalContent, document.body);
|
|
9710
10543
|
};
|
|
9711
10544
|
function useMilestoneData(options) {
|
|
9712
|
-
const { context, actions } = options || {};
|
|
10545
|
+
const { context: context2, actions } = options || {};
|
|
9713
10546
|
const [milestones, setMilestones] = useState([]);
|
|
9714
10547
|
const [isLoading, setIsLoading] = useState(true);
|
|
9715
10548
|
const [error, setError] = useState(null);
|
|
@@ -9717,12 +10550,12 @@ function useMilestoneData(options) {
|
|
|
9717
10550
|
const [canWrite, setCanWrite] = useState(false);
|
|
9718
10551
|
const coreRef = useRef(null);
|
|
9719
10552
|
const activeFilePathRef = useRef(null);
|
|
9720
|
-
const contextRef = useRef(
|
|
10553
|
+
const contextRef = useRef(context2);
|
|
9721
10554
|
const actionsRef = useRef(actions);
|
|
9722
10555
|
useEffect(() => {
|
|
9723
|
-
contextRef.current =
|
|
10556
|
+
contextRef.current = context2;
|
|
9724
10557
|
actionsRef.current = actions;
|
|
9725
|
-
}, [
|
|
10558
|
+
}, [context2, actions]);
|
|
9726
10559
|
const fetchFileContent = useCallback(async (path2) => {
|
|
9727
10560
|
var _a;
|
|
9728
10561
|
const currentContext = contextRef.current;
|
|
@@ -9746,7 +10579,7 @@ function useMilestoneData(options) {
|
|
|
9746
10579
|
const fileTreeVersionRef = useRef(null);
|
|
9747
10580
|
const loadMilestoneData = useCallback(async () => {
|
|
9748
10581
|
var _a, _b, _c;
|
|
9749
|
-
if (!
|
|
10582
|
+
if (!context2 || !actions) {
|
|
9750
10583
|
console.log("[useMilestoneData] No context provided");
|
|
9751
10584
|
setIsBacklogProject(false);
|
|
9752
10585
|
setMilestones([]);
|
|
@@ -9755,7 +10588,7 @@ function useMilestoneData(options) {
|
|
|
9755
10588
|
fileTreeVersionRef.current = null;
|
|
9756
10589
|
return;
|
|
9757
10590
|
}
|
|
9758
|
-
const fileTreeSlice =
|
|
10591
|
+
const fileTreeSlice = context2.fileTree;
|
|
9759
10592
|
if (!((_a = fileTreeSlice == null ? void 0 : fileTreeSlice.data) == null ? void 0 : _a.allFiles)) {
|
|
9760
10593
|
console.log("[useMilestoneData] FileTree not available");
|
|
9761
10594
|
setIsBacklogProject(false);
|
|
@@ -9783,7 +10616,7 @@ function useMilestoneData(options) {
|
|
|
9783
10616
|
const fs = new PanelFileSystemAdapter({
|
|
9784
10617
|
fetchFile: fetchFileContent,
|
|
9785
10618
|
filePaths,
|
|
9786
|
-
hostFileSystem: (_c =
|
|
10619
|
+
hostFileSystem: (_c = context2.adapters) == null ? void 0 : _c.fileSystem
|
|
9787
10620
|
});
|
|
9788
10621
|
const core2 = new Core({
|
|
9789
10622
|
projectRoot: "",
|
|
@@ -9856,7 +10689,7 @@ function useMilestoneData(options) {
|
|
|
9856
10689
|
} finally {
|
|
9857
10690
|
setIsLoading(false);
|
|
9858
10691
|
}
|
|
9859
|
-
}, [
|
|
10692
|
+
}, [context2, actions, fetchFileContent]);
|
|
9860
10693
|
useEffect(() => {
|
|
9861
10694
|
loadMilestoneData();
|
|
9862
10695
|
}, [loadMilestoneData]);
|
|
@@ -10240,7 +11073,7 @@ const MilestoneModal = ({
|
|
|
10240
11073
|
return createPortal(modalContent, document.body);
|
|
10241
11074
|
};
|
|
10242
11075
|
const KanbanPanel = ({
|
|
10243
|
-
context,
|
|
11076
|
+
context: context2,
|
|
10244
11077
|
actions,
|
|
10245
11078
|
events: events2
|
|
10246
11079
|
}) => {
|
|
@@ -10260,6 +11093,27 @@ const KanbanPanel = ({
|
|
|
10260
11093
|
const [selectedMilestoneId, setSelectedMilestoneId] = useState(null);
|
|
10261
11094
|
const [milestoneStatusFilter, setMilestoneStatusFilter] = useState(null);
|
|
10262
11095
|
const [searchQuery, setSearchQuery] = useState("");
|
|
11096
|
+
const searchDebounceRef = useRef(null);
|
|
11097
|
+
const handleSearchChange = useCallback((value) => {
|
|
11098
|
+
setSearchQuery(value);
|
|
11099
|
+
if (searchDebounceRef.current) {
|
|
11100
|
+
clearTimeout(searchDebounceRef.current);
|
|
11101
|
+
}
|
|
11102
|
+
searchDebounceRef.current = setTimeout(() => {
|
|
11103
|
+
const activeSpan = getActiveSpan();
|
|
11104
|
+
if (value.trim()) {
|
|
11105
|
+
activeSpan == null ? void 0 : activeSpan.addEvent("search.performed", {
|
|
11106
|
+
"search.query": value.trim()
|
|
11107
|
+
// Note: results.count is approximate since filteredTasksByStatus updates async
|
|
11108
|
+
});
|
|
11109
|
+
}
|
|
11110
|
+
}, 500);
|
|
11111
|
+
}, []);
|
|
11112
|
+
const handleClearSearch = useCallback(() => {
|
|
11113
|
+
setSearchQuery("");
|
|
11114
|
+
const activeSpan = getActiveSpan();
|
|
11115
|
+
activeSpan == null ? void 0 : activeSpan.addEvent("filter.cleared");
|
|
11116
|
+
}, []);
|
|
10263
11117
|
const sensors = useSensors(
|
|
10264
11118
|
useSensor(PointerSensor, {
|
|
10265
11119
|
activationConstraint: {
|
|
@@ -10316,7 +11170,7 @@ const KanbanPanel = ({
|
|
|
10316
11170
|
canWrite,
|
|
10317
11171
|
core: core2
|
|
10318
11172
|
} = useKanbanData({
|
|
10319
|
-
context,
|
|
11173
|
+
context: context2,
|
|
10320
11174
|
actions,
|
|
10321
11175
|
events: events2,
|
|
10322
11176
|
tasksLimit: 20
|
|
@@ -10329,7 +11183,7 @@ const KanbanPanel = ({
|
|
|
10329
11183
|
canWrite: canWriteMilestones,
|
|
10330
11184
|
core: milestoneCore
|
|
10331
11185
|
} = useMilestoneData({
|
|
10332
|
-
context,
|
|
11186
|
+
context: context2,
|
|
10333
11187
|
actions
|
|
10334
11188
|
});
|
|
10335
11189
|
const filteredTasksByStatus = useMemo(() => {
|
|
@@ -10352,28 +11206,84 @@ const KanbanPanel = ({
|
|
|
10352
11206
|
}
|
|
10353
11207
|
return filtered;
|
|
10354
11208
|
}, [tasksByStatus, searchQuery]);
|
|
11209
|
+
const dragSpanRef = useRef(null);
|
|
10355
11210
|
const handleDragStart = useCallback((event) => {
|
|
10356
11211
|
const { active } = event;
|
|
10357
11212
|
const task = getTaskById(active.id);
|
|
10358
11213
|
if (task) {
|
|
10359
11214
|
setActiveTask(task);
|
|
11215
|
+
const tracer = getTracer();
|
|
11216
|
+
const span = tracer.startSpan("task.edit", {
|
|
11217
|
+
attributes: {
|
|
11218
|
+
"input.taskId": task.id,
|
|
11219
|
+
"input.fromStatus": task.status || "unknown"
|
|
11220
|
+
}
|
|
11221
|
+
});
|
|
11222
|
+
dragSpanRef.current = span;
|
|
11223
|
+
span.addEvent("task.drag.started", {
|
|
11224
|
+
"task.id": task.id,
|
|
11225
|
+
"from.status": task.status || "unknown"
|
|
11226
|
+
});
|
|
10360
11227
|
}
|
|
10361
11228
|
}, [getTaskById]);
|
|
10362
11229
|
const handleDragEnd = useCallback((event) => {
|
|
10363
11230
|
const { active, over } = event;
|
|
11231
|
+
const span = dragSpanRef.current;
|
|
10364
11232
|
setActiveTask(null);
|
|
10365
|
-
if (!over)
|
|
11233
|
+
if (!over) {
|
|
11234
|
+
if (span) {
|
|
11235
|
+
span.addEvent("task.drag.cancelled");
|
|
11236
|
+
span.setAttributes({ "output.cancelled": true });
|
|
11237
|
+
span.setStatus({ code: SpanStatusCode.OK });
|
|
11238
|
+
span.end();
|
|
11239
|
+
dragSpanRef.current = null;
|
|
11240
|
+
}
|
|
11241
|
+
return;
|
|
11242
|
+
}
|
|
10366
11243
|
const taskId = active.id;
|
|
10367
11244
|
const targetColumn = over.id;
|
|
10368
11245
|
const task = getTaskById(taskId);
|
|
10369
|
-
if (!task)
|
|
11246
|
+
if (!task) {
|
|
11247
|
+
if (span) {
|
|
11248
|
+
span.setStatus({ code: SpanStatusCode.ERROR, message: "Task not found" });
|
|
11249
|
+
span.end();
|
|
11250
|
+
dragSpanRef.current = null;
|
|
11251
|
+
}
|
|
11252
|
+
return;
|
|
11253
|
+
}
|
|
10370
11254
|
const currentColumn = task.status || DEFAULT_TASK_STATUSES.TODO;
|
|
10371
11255
|
if (currentColumn !== targetColumn) {
|
|
10372
|
-
|
|
11256
|
+
if (span) {
|
|
11257
|
+
withSpan(span, async () => {
|
|
11258
|
+
moveTaskOptimistic(taskId, targetColumn);
|
|
11259
|
+
});
|
|
11260
|
+
span.setAttributes({
|
|
11261
|
+
"output.toStatus": targetColumn,
|
|
11262
|
+
"output.moved": true
|
|
11263
|
+
});
|
|
11264
|
+
span.setStatus({ code: SpanStatusCode.OK });
|
|
11265
|
+
span.end();
|
|
11266
|
+
dragSpanRef.current = null;
|
|
11267
|
+
} else {
|
|
11268
|
+
moveTaskOptimistic(taskId, targetColumn);
|
|
11269
|
+
}
|
|
11270
|
+
} else {
|
|
11271
|
+
if (span) {
|
|
11272
|
+
span.addEvent("task.drag.cancelled");
|
|
11273
|
+
span.setAttributes({ "output.cancelled": true, "output.reason": "same_column" });
|
|
11274
|
+
span.setStatus({ code: SpanStatusCode.OK });
|
|
11275
|
+
span.end();
|
|
11276
|
+
dragSpanRef.current = null;
|
|
11277
|
+
}
|
|
10373
11278
|
}
|
|
10374
11279
|
}, [getTaskById, moveTaskOptimistic]);
|
|
10375
11280
|
const handleTaskClick = (task) => {
|
|
10376
11281
|
setSelectedTaskId(task.id);
|
|
11282
|
+
const activeSpan = getActiveSpan();
|
|
11283
|
+
activeSpan == null ? void 0 : activeSpan.addEvent("task.selected", {
|
|
11284
|
+
"task.id": task.id,
|
|
11285
|
+
"task.status": task.status || "unknown"
|
|
11286
|
+
});
|
|
10377
11287
|
if (events2) {
|
|
10378
11288
|
events2.emit({
|
|
10379
11289
|
type: "task:selected",
|
|
@@ -10383,16 +11293,16 @@ const KanbanPanel = ({
|
|
|
10383
11293
|
});
|
|
10384
11294
|
}
|
|
10385
11295
|
};
|
|
10386
|
-
const fileSystem = (_a =
|
|
11296
|
+
const fileSystem = (_a = context2.adapters) == null ? void 0 : _a.fileSystem;
|
|
10387
11297
|
const canInitialize = Boolean(
|
|
10388
|
-
(fileSystem == null ? void 0 : fileSystem.writeFile) && (fileSystem == null ? void 0 : fileSystem.createDir) && ((_b =
|
|
11298
|
+
(fileSystem == null ? void 0 : fileSystem.writeFile) && (fileSystem == null ? void 0 : fileSystem.createDir) && ((_b = context2.currentScope.repository) == null ? void 0 : _b.path)
|
|
10389
11299
|
);
|
|
10390
11300
|
const handleInitialize = useCallback(async () => {
|
|
10391
11301
|
var _a2, _b2;
|
|
10392
11302
|
if (!(fileSystem == null ? void 0 : fileSystem.writeFile) || !(fileSystem == null ? void 0 : fileSystem.createDir)) {
|
|
10393
11303
|
throw new Error("File system adapter not available");
|
|
10394
11304
|
}
|
|
10395
|
-
const repoPath = (_a2 =
|
|
11305
|
+
const repoPath = (_a2 = context2.currentScope.repository) == null ? void 0 : _a2.path;
|
|
10396
11306
|
if (!repoPath) {
|
|
10397
11307
|
throw new Error("Repository path not available");
|
|
10398
11308
|
}
|
|
@@ -10439,32 +11349,80 @@ const KanbanPanel = ({
|
|
|
10439
11349
|
projectRoot: repoPath,
|
|
10440
11350
|
adapters: { fs: fsAdapter }
|
|
10441
11351
|
});
|
|
10442
|
-
const projectName = ((_b2 =
|
|
11352
|
+
const projectName = ((_b2 = context2.currentScope.repository) == null ? void 0 : _b2.name) || "Backlog";
|
|
10443
11353
|
await core22.initProject({ projectName });
|
|
10444
11354
|
await refreshData();
|
|
10445
|
-
}, [fileSystem,
|
|
11355
|
+
}, [fileSystem, context2.currentScope.repository, refreshData]);
|
|
11356
|
+
const taskSaveCompletedRef = useRef(false);
|
|
11357
|
+
const taskModalSpanRef = useRef(null);
|
|
10446
11358
|
const handleOpenNewTask = useCallback(() => {
|
|
10447
11359
|
setEditingTask(void 0);
|
|
10448
11360
|
setIsTaskModalOpen(true);
|
|
10449
|
-
|
|
10450
|
-
|
|
10451
|
-
|
|
10452
|
-
|
|
11361
|
+
taskSaveCompletedRef.current = false;
|
|
11362
|
+
const tracer = getTracer();
|
|
11363
|
+
const span = tracer.startSpan("task.create");
|
|
11364
|
+
taskModalSpanRef.current = span;
|
|
11365
|
+
span.addEvent("modal.opened", {
|
|
11366
|
+
"modal.type": "task",
|
|
11367
|
+
"modal.mode": "create"
|
|
11368
|
+
});
|
|
10453
11369
|
}, []);
|
|
10454
11370
|
const handleCloseTaskModal = useCallback(() => {
|
|
11371
|
+
const span = taskModalSpanRef.current;
|
|
11372
|
+
if (!taskSaveCompletedRef.current && span) {
|
|
11373
|
+
span.addEvent("modal.cancelled", {
|
|
11374
|
+
"had.changes": false
|
|
11375
|
+
// We don't track dirty state yet
|
|
11376
|
+
});
|
|
11377
|
+
span.setAttributes({ "output.cancelled": true });
|
|
11378
|
+
span.setStatus({ code: SpanStatusCode.OK });
|
|
11379
|
+
span.end();
|
|
11380
|
+
}
|
|
10455
11381
|
setIsTaskModalOpen(false);
|
|
10456
11382
|
setEditingTask(void 0);
|
|
11383
|
+
taskModalSpanRef.current = null;
|
|
10457
11384
|
}, []);
|
|
10458
11385
|
const handleSaveTask = useCallback(async (input) => {
|
|
10459
11386
|
if (!core2) {
|
|
10460
11387
|
throw new Error("Backlog not loaded");
|
|
10461
11388
|
}
|
|
10462
|
-
|
|
10463
|
-
|
|
10464
|
-
|
|
10465
|
-
|
|
11389
|
+
const span = taskModalSpanRef.current;
|
|
11390
|
+
const isEditing = !!editingTask;
|
|
11391
|
+
try {
|
|
11392
|
+
if (isEditing) {
|
|
11393
|
+
await core2.updateTask(editingTask.id, input);
|
|
11394
|
+
span == null ? void 0 : span.addEvent("task.updated", {
|
|
11395
|
+
"task.id": editingTask.id,
|
|
11396
|
+
"updated.fields": Object.keys(input).join(", ")
|
|
11397
|
+
});
|
|
11398
|
+
} else {
|
|
11399
|
+
const newTask = await core2.createTask(input);
|
|
11400
|
+
span == null ? void 0 : span.addEvent("task.created", {
|
|
11401
|
+
"task.id": (newTask == null ? void 0 : newTask.id) || "unknown",
|
|
11402
|
+
"task.status": input.status || "To Do"
|
|
11403
|
+
});
|
|
11404
|
+
}
|
|
11405
|
+
taskSaveCompletedRef.current = true;
|
|
11406
|
+
if (span) {
|
|
11407
|
+
span.setAttributes({
|
|
11408
|
+
"output.success": true,
|
|
11409
|
+
"output.operation": isEditing ? "update" : "create"
|
|
11410
|
+
});
|
|
11411
|
+
span.setStatus({ code: SpanStatusCode.OK });
|
|
11412
|
+
span.end();
|
|
11413
|
+
taskModalSpanRef.current = null;
|
|
11414
|
+
}
|
|
11415
|
+
await refreshData();
|
|
11416
|
+
} catch (err) {
|
|
11417
|
+
const errorMessage = err instanceof Error ? err.message : "Failed to save task";
|
|
11418
|
+
span == null ? void 0 : span.addEvent("task.save.error", {
|
|
11419
|
+
"error.type": err instanceof Error ? err.name : "Unknown",
|
|
11420
|
+
"error.message": errorMessage
|
|
11421
|
+
});
|
|
11422
|
+
span == null ? void 0 : span.recordException(err);
|
|
11423
|
+
span == null ? void 0 : span.setStatus({ code: SpanStatusCode.ERROR, message: errorMessage });
|
|
11424
|
+
throw err;
|
|
10466
11425
|
}
|
|
10467
|
-
await refreshData();
|
|
10468
11426
|
}, [core2, editingTask, refreshData]);
|
|
10469
11427
|
const handleOpenNewMilestone = useCallback(() => {
|
|
10470
11428
|
setEditingMilestone(void 0);
|
|
@@ -10659,7 +11617,7 @@ const KanbanPanel = ({
|
|
|
10659
11617
|
type: "text",
|
|
10660
11618
|
placeholder: "Search tasks...",
|
|
10661
11619
|
value: searchQuery,
|
|
10662
|
-
onChange: (e) =>
|
|
11620
|
+
onChange: (e) => handleSearchChange(e.target.value),
|
|
10663
11621
|
style: {
|
|
10664
11622
|
width: "100%",
|
|
10665
11623
|
padding: "8px 32px 8px 32px",
|
|
@@ -10677,7 +11635,7 @@ const KanbanPanel = ({
|
|
|
10677
11635
|
searchQuery && /* @__PURE__ */ jsx(
|
|
10678
11636
|
"button",
|
|
10679
11637
|
{
|
|
10680
|
-
onClick:
|
|
11638
|
+
onClick: handleClearSearch,
|
|
10681
11639
|
style: {
|
|
10682
11640
|
position: "absolute",
|
|
10683
11641
|
right: "6px",
|
|
@@ -14630,13 +15588,13 @@ function classifyCharacter(code2) {
|
|
|
14630
15588
|
return 2;
|
|
14631
15589
|
}
|
|
14632
15590
|
}
|
|
14633
|
-
function resolveAll(constructs2, events2,
|
|
15591
|
+
function resolveAll(constructs2, events2, context2) {
|
|
14634
15592
|
const called = [];
|
|
14635
15593
|
let index2 = -1;
|
|
14636
15594
|
while (++index2 < constructs2.length) {
|
|
14637
15595
|
const resolve = constructs2[index2].resolveAll;
|
|
14638
15596
|
if (resolve && !called.includes(resolve)) {
|
|
14639
|
-
events2 = resolve(events2,
|
|
15597
|
+
events2 = resolve(events2, context2);
|
|
14640
15598
|
called.push(resolve);
|
|
14641
15599
|
}
|
|
14642
15600
|
}
|
|
@@ -14647,7 +15605,7 @@ const attention = {
|
|
|
14647
15605
|
resolveAll: resolveAllAttention,
|
|
14648
15606
|
tokenize: tokenizeAttention
|
|
14649
15607
|
};
|
|
14650
|
-
function resolveAllAttention(events2,
|
|
15608
|
+
function resolveAllAttention(events2, context2) {
|
|
14651
15609
|
let index2 = -1;
|
|
14652
15610
|
let open;
|
|
14653
15611
|
let group;
|
|
@@ -14662,7 +15620,7 @@ function resolveAllAttention(events2, context) {
|
|
|
14662
15620
|
open = index2;
|
|
14663
15621
|
while (open--) {
|
|
14664
15622
|
if (events2[open][0] === "exit" && events2[open][1].type === "attentionSequence" && events2[open][1]._open && // If the markers are the same:
|
|
14665
|
-
|
|
15623
|
+
context2.sliceSerialize(events2[open][1]).charCodeAt(0) === context2.sliceSerialize(events2[index2][1]).charCodeAt(0)) {
|
|
14666
15624
|
if ((events2[open][1]._close || events2[index2][1]._open) && (events2[index2][1].end.offset - events2[index2][1].start.offset) % 3 && !((events2[open][1].end.offset - events2[open][1].start.offset + events2[index2][1].end.offset - events2[index2][1].start.offset) % 3)) {
|
|
14667
15625
|
continue;
|
|
14668
15626
|
}
|
|
@@ -14715,14 +15673,14 @@ function resolveAllAttention(events2, context) {
|
|
|
14715
15673
|
};
|
|
14716
15674
|
nextEvents = [];
|
|
14717
15675
|
if (events2[open][1].end.offset - events2[open][1].start.offset) {
|
|
14718
|
-
nextEvents = push(nextEvents, [["enter", events2[open][1],
|
|
15676
|
+
nextEvents = push(nextEvents, [["enter", events2[open][1], context2], ["exit", events2[open][1], context2]]);
|
|
14719
15677
|
}
|
|
14720
|
-
nextEvents = push(nextEvents, [["enter", group,
|
|
14721
|
-
nextEvents = push(nextEvents, resolveAll(
|
|
14722
|
-
nextEvents = push(nextEvents, [["exit", text2,
|
|
15678
|
+
nextEvents = push(nextEvents, [["enter", group, context2], ["enter", openingSequence, context2], ["exit", openingSequence, context2], ["enter", text2, context2]]);
|
|
15679
|
+
nextEvents = push(nextEvents, resolveAll(context2.parser.constructs.insideSpan.null, events2.slice(open + 1, index2), context2));
|
|
15680
|
+
nextEvents = push(nextEvents, [["exit", text2, context2], ["enter", closingSequence, context2], ["exit", closingSequence, context2], ["exit", group, context2]]);
|
|
14723
15681
|
if (events2[index2][1].end.offset - events2[index2][1].start.offset) {
|
|
14724
15682
|
offset = 2;
|
|
14725
|
-
nextEvents = push(nextEvents, [["enter", events2[index2][1],
|
|
15683
|
+
nextEvents = push(nextEvents, [["enter", events2[index2][1], context2], ["exit", events2[index2][1], context2]]);
|
|
14726
15684
|
} else {
|
|
14727
15685
|
offset = 0;
|
|
14728
15686
|
}
|
|
@@ -15645,12 +16603,12 @@ function subtokenize(eventsArray) {
|
|
|
15645
16603
|
}
|
|
15646
16604
|
function subcontent(events2, eventIndex) {
|
|
15647
16605
|
const token = events2.get(eventIndex)[1];
|
|
15648
|
-
const
|
|
16606
|
+
const context2 = events2.get(eventIndex)[2];
|
|
15649
16607
|
let startPosition = eventIndex - 1;
|
|
15650
16608
|
const startPositions = [];
|
|
15651
16609
|
let tokenizer = token._tokenizer;
|
|
15652
16610
|
if (!tokenizer) {
|
|
15653
|
-
tokenizer =
|
|
16611
|
+
tokenizer = context2.parser[token.contentType](token.start);
|
|
15654
16612
|
if (token._contentTypeTextTrailing) {
|
|
15655
16613
|
tokenizer._contentTypeTextTrailing = true;
|
|
15656
16614
|
}
|
|
@@ -15670,7 +16628,7 @@ function subcontent(events2, eventIndex) {
|
|
|
15670
16628
|
}
|
|
15671
16629
|
startPositions.push(startPosition);
|
|
15672
16630
|
if (!current._tokenizer) {
|
|
15673
|
-
stream =
|
|
16631
|
+
stream = context2.sliceStream(current);
|
|
15674
16632
|
if (!current.next) {
|
|
15675
16633
|
stream.push(null);
|
|
15676
16634
|
}
|
|
@@ -16126,7 +17084,7 @@ const headingAtx = {
|
|
|
16126
17084
|
resolve: resolveHeadingAtx,
|
|
16127
17085
|
tokenize: tokenizeHeadingAtx
|
|
16128
17086
|
};
|
|
16129
|
-
function resolveHeadingAtx(events2,
|
|
17087
|
+
function resolveHeadingAtx(events2, context2) {
|
|
16130
17088
|
let contentEnd = events2.length - 2;
|
|
16131
17089
|
let contentStart = 3;
|
|
16132
17090
|
let content2;
|
|
@@ -16152,7 +17110,7 @@ function resolveHeadingAtx(events2, context) {
|
|
|
16152
17110
|
end: events2[contentEnd][1].end,
|
|
16153
17111
|
contentType: "text"
|
|
16154
17112
|
};
|
|
16155
|
-
splice(events2, contentStart, contentEnd - contentStart + 1, [["enter", content2,
|
|
17113
|
+
splice(events2, contentStart, contentEnd - contentStart + 1, [["enter", content2, context2], ["enter", text2, context2], ["exit", text2, context2], ["exit", content2, context2]]);
|
|
16156
17114
|
}
|
|
16157
17115
|
return events2;
|
|
16158
17116
|
}
|
|
@@ -16988,7 +17946,7 @@ function resolveAllLabelEnd(events2) {
|
|
|
16988
17946
|
}
|
|
16989
17947
|
return events2;
|
|
16990
17948
|
}
|
|
16991
|
-
function resolveToLabelEnd(events2,
|
|
17949
|
+
function resolveToLabelEnd(events2, context2) {
|
|
16992
17950
|
let index2 = events2.length;
|
|
16993
17951
|
let offset = 0;
|
|
16994
17952
|
let token;
|
|
@@ -17043,13 +18001,13 @@ function resolveToLabelEnd(events2, context) {
|
|
|
17043
18001
|
...events2[close - 2][1].start
|
|
17044
18002
|
}
|
|
17045
18003
|
};
|
|
17046
|
-
media = [["enter", group,
|
|
18004
|
+
media = [["enter", group, context2], ["enter", label, context2]];
|
|
17047
18005
|
media = push(media, events2.slice(open + 1, open + offset + 3));
|
|
17048
|
-
media = push(media, [["enter", text2,
|
|
17049
|
-
media = push(media, resolveAll(
|
|
17050
|
-
media = push(media, [["exit", text2,
|
|
18006
|
+
media = push(media, [["enter", text2, context2]]);
|
|
18007
|
+
media = push(media, resolveAll(context2.parser.constructs.insideSpan.null, events2.slice(open + offset + 4, close - 3), context2));
|
|
18008
|
+
media = push(media, [["exit", text2, context2], events2[close - 2], events2[close - 1], ["exit", label, context2]]);
|
|
17051
18009
|
media = push(media, events2.slice(close + 1));
|
|
17052
|
-
media = push(media, [["exit", group,
|
|
18010
|
+
media = push(media, [["exit", group, context2]]);
|
|
17053
18011
|
splice(events2, open, events2.length, media);
|
|
17054
18012
|
return events2;
|
|
17055
18013
|
}
|
|
@@ -17412,7 +18370,7 @@ const setextUnderline = {
|
|
|
17412
18370
|
resolveTo: resolveToSetextUnderline,
|
|
17413
18371
|
tokenize: tokenizeSetextUnderline
|
|
17414
18372
|
};
|
|
17415
|
-
function resolveToSetextUnderline(events2,
|
|
18373
|
+
function resolveToSetextUnderline(events2, context2) {
|
|
17416
18374
|
let index2 = events2.length;
|
|
17417
18375
|
let content2;
|
|
17418
18376
|
let text2;
|
|
@@ -17446,15 +18404,15 @@ function resolveToSetextUnderline(events2, context) {
|
|
|
17446
18404
|
};
|
|
17447
18405
|
events2[text2][1].type = "setextHeadingText";
|
|
17448
18406
|
if (definition2) {
|
|
17449
|
-
events2.splice(text2, 0, ["enter", heading2,
|
|
17450
|
-
events2.splice(definition2 + 1, 0, ["exit", events2[content2][1],
|
|
18407
|
+
events2.splice(text2, 0, ["enter", heading2, context2]);
|
|
18408
|
+
events2.splice(definition2 + 1, 0, ["exit", events2[content2][1], context2]);
|
|
17451
18409
|
events2[content2][1].end = {
|
|
17452
18410
|
...events2[definition2][1].end
|
|
17453
18411
|
};
|
|
17454
18412
|
} else {
|
|
17455
18413
|
events2[content2][1] = heading2;
|
|
17456
18414
|
}
|
|
17457
|
-
events2.push(["exit", heading2,
|
|
18415
|
+
events2.push(["exit", heading2, context2]);
|
|
17458
18416
|
return events2;
|
|
17459
18417
|
}
|
|
17460
18418
|
function tokenizeSetextUnderline(effects, ok2, nok) {
|
|
@@ -17588,7 +18546,7 @@ function initializeFactory(field) {
|
|
|
17588
18546
|
}
|
|
17589
18547
|
function createResolver(extraResolver) {
|
|
17590
18548
|
return resolveAllText;
|
|
17591
|
-
function resolveAllText(events2,
|
|
18549
|
+
function resolveAllText(events2, context2) {
|
|
17592
18550
|
let index2 = -1;
|
|
17593
18551
|
let enter;
|
|
17594
18552
|
while (++index2 <= events2.length) {
|
|
@@ -17606,15 +18564,15 @@ function createResolver(extraResolver) {
|
|
|
17606
18564
|
enter = void 0;
|
|
17607
18565
|
}
|
|
17608
18566
|
}
|
|
17609
|
-
return extraResolver ? extraResolver(events2,
|
|
18567
|
+
return extraResolver ? extraResolver(events2, context2) : events2;
|
|
17610
18568
|
}
|
|
17611
18569
|
}
|
|
17612
|
-
function resolveAllLineSuffixes(events2,
|
|
18570
|
+
function resolveAllLineSuffixes(events2, context2) {
|
|
17613
18571
|
let eventIndex = 0;
|
|
17614
18572
|
while (++eventIndex <= events2.length) {
|
|
17615
18573
|
if ((eventIndex === events2.length || events2[eventIndex][1].type === "lineEnding") && events2[eventIndex - 1][1].type === "data") {
|
|
17616
18574
|
const data = events2[eventIndex - 1][1];
|
|
17617
|
-
const chunks =
|
|
18575
|
+
const chunks = context2.sliceStream(data);
|
|
17618
18576
|
let index2 = chunks.length;
|
|
17619
18577
|
let bufferIndex = -1;
|
|
17620
18578
|
let size = 0;
|
|
@@ -17638,7 +18596,7 @@ function resolveAllLineSuffixes(events2, context) {
|
|
|
17638
18596
|
break;
|
|
17639
18597
|
}
|
|
17640
18598
|
}
|
|
17641
|
-
if (
|
|
18599
|
+
if (context2._contentTypeTextTrailing && eventIndex === events2.length) {
|
|
17642
18600
|
size = 0;
|
|
17643
18601
|
}
|
|
17644
18602
|
if (size) {
|
|
@@ -17661,7 +18619,7 @@ function resolveAllLineSuffixes(events2, context) {
|
|
|
17661
18619
|
if (data.start.offset === data.end.offset) {
|
|
17662
18620
|
Object.assign(data, token);
|
|
17663
18621
|
} else {
|
|
17664
|
-
events2.splice(eventIndex, 0, ["enter", token,
|
|
18622
|
+
events2.splice(eventIndex, 0, ["enter", token, context2], ["exit", token, context2]);
|
|
17665
18623
|
eventIndex += 2;
|
|
17666
18624
|
}
|
|
17667
18625
|
}
|
|
@@ -17765,7 +18723,7 @@ function createTokenizer(parser, initialize, from) {
|
|
|
17765
18723
|
interrupt: true
|
|
17766
18724
|
})
|
|
17767
18725
|
};
|
|
17768
|
-
const
|
|
18726
|
+
const context2 = {
|
|
17769
18727
|
code: null,
|
|
17770
18728
|
containerState: {},
|
|
17771
18729
|
defineSkip,
|
|
@@ -17777,11 +18735,11 @@ function createTokenizer(parser, initialize, from) {
|
|
|
17777
18735
|
sliceStream,
|
|
17778
18736
|
write
|
|
17779
18737
|
};
|
|
17780
|
-
let state = initialize.tokenize.call(
|
|
18738
|
+
let state = initialize.tokenize.call(context2, effects);
|
|
17781
18739
|
if (initialize.resolveAll) {
|
|
17782
18740
|
resolveAllConstructs.push(initialize);
|
|
17783
18741
|
}
|
|
17784
|
-
return
|
|
18742
|
+
return context2;
|
|
17785
18743
|
function write(slice) {
|
|
17786
18744
|
chunks = push(chunks, slice);
|
|
17787
18745
|
main();
|
|
@@ -17789,8 +18747,8 @@ function createTokenizer(parser, initialize, from) {
|
|
|
17789
18747
|
return [];
|
|
17790
18748
|
}
|
|
17791
18749
|
addResult(initialize, 0);
|
|
17792
|
-
|
|
17793
|
-
return
|
|
18750
|
+
context2.events = resolveAll(resolveAllConstructs, context2.events, context2);
|
|
18751
|
+
return context2.events;
|
|
17794
18752
|
}
|
|
17795
18753
|
function sliceSerialize(token, expandTabs) {
|
|
17796
18754
|
return serializeChunks(sliceStream(token), expandTabs);
|
|
@@ -17860,20 +18818,20 @@ function createTokenizer(parser, initialize, from) {
|
|
|
17860
18818
|
point2._index++;
|
|
17861
18819
|
}
|
|
17862
18820
|
}
|
|
17863
|
-
|
|
18821
|
+
context2.previous = code2;
|
|
17864
18822
|
}
|
|
17865
18823
|
function enter(type, fields) {
|
|
17866
18824
|
const token = fields || {};
|
|
17867
18825
|
token.type = type;
|
|
17868
18826
|
token.start = now();
|
|
17869
|
-
|
|
18827
|
+
context2.events.push(["enter", token, context2]);
|
|
17870
18828
|
stack.push(token);
|
|
17871
18829
|
return token;
|
|
17872
18830
|
}
|
|
17873
18831
|
function exit2(type) {
|
|
17874
18832
|
const token = stack.pop();
|
|
17875
18833
|
token.end = now();
|
|
17876
|
-
|
|
18834
|
+
context2.events.push(["exit", token, context2]);
|
|
17877
18835
|
return token;
|
|
17878
18836
|
}
|
|
17879
18837
|
function onsuccessfulconstruct(construct, info) {
|
|
@@ -17927,16 +18885,16 @@ function createTokenizer(parser, initialize, from) {
|
|
|
17927
18885
|
info = store();
|
|
17928
18886
|
currentConstruct = construct;
|
|
17929
18887
|
if (!construct.partial) {
|
|
17930
|
-
|
|
18888
|
+
context2.currentConstruct = construct;
|
|
17931
18889
|
}
|
|
17932
|
-
if (construct.name &&
|
|
18890
|
+
if (construct.name && context2.parser.constructs.disable.null.includes(construct.name)) {
|
|
17933
18891
|
return nok();
|
|
17934
18892
|
}
|
|
17935
18893
|
return construct.tokenize.call(
|
|
17936
18894
|
// If we do have fields, create an object w/ `context` as its
|
|
17937
18895
|
// prototype.
|
|
17938
18896
|
// This allows a “live binding”, which is needed for `interrupt`.
|
|
17939
|
-
fields ? Object.assign(Object.create(
|
|
18897
|
+
fields ? Object.assign(Object.create(context2), fields) : context2,
|
|
17940
18898
|
effects,
|
|
17941
18899
|
ok2,
|
|
17942
18900
|
nok
|
|
@@ -17961,17 +18919,17 @@ function createTokenizer(parser, initialize, from) {
|
|
|
17961
18919
|
resolveAllConstructs.push(construct);
|
|
17962
18920
|
}
|
|
17963
18921
|
if (construct.resolve) {
|
|
17964
|
-
splice(
|
|
18922
|
+
splice(context2.events, from2, context2.events.length - from2, construct.resolve(context2.events.slice(from2), context2));
|
|
17965
18923
|
}
|
|
17966
18924
|
if (construct.resolveTo) {
|
|
17967
|
-
|
|
18925
|
+
context2.events = construct.resolveTo(context2.events, context2);
|
|
17968
18926
|
}
|
|
17969
18927
|
}
|
|
17970
18928
|
function store() {
|
|
17971
18929
|
const startPoint = now();
|
|
17972
|
-
const startPrevious =
|
|
17973
|
-
const startCurrentConstruct =
|
|
17974
|
-
const startEventsIndex =
|
|
18930
|
+
const startPrevious = context2.previous;
|
|
18931
|
+
const startCurrentConstruct = context2.currentConstruct;
|
|
18932
|
+
const startEventsIndex = context2.events.length;
|
|
17975
18933
|
const startStack = Array.from(stack);
|
|
17976
18934
|
return {
|
|
17977
18935
|
from: startEventsIndex,
|
|
@@ -17979,9 +18937,9 @@ function createTokenizer(parser, initialize, from) {
|
|
|
17979
18937
|
};
|
|
17980
18938
|
function restore() {
|
|
17981
18939
|
point2 = startPoint;
|
|
17982
|
-
|
|
17983
|
-
|
|
17984
|
-
|
|
18940
|
+
context2.previous = startPrevious;
|
|
18941
|
+
context2.currentConstruct = startCurrentConstruct;
|
|
18942
|
+
context2.events.length = startEventsIndex;
|
|
17985
18943
|
stack = startStack;
|
|
17986
18944
|
accountForPotentialSkip();
|
|
17987
18945
|
}
|
|
@@ -18294,7 +19252,7 @@ function compiler(options) {
|
|
|
18294
19252
|
type: "root",
|
|
18295
19253
|
children: []
|
|
18296
19254
|
};
|
|
18297
|
-
const
|
|
19255
|
+
const context2 = {
|
|
18298
19256
|
stack: [tree],
|
|
18299
19257
|
tokenStack: [],
|
|
18300
19258
|
config,
|
|
@@ -18322,13 +19280,13 @@ function compiler(options) {
|
|
|
18322
19280
|
if (own$6.call(handler, events2[index2][1].type)) {
|
|
18323
19281
|
handler[events2[index2][1].type].call(Object.assign({
|
|
18324
19282
|
sliceSerialize: events2[index2][2].sliceSerialize
|
|
18325
|
-
},
|
|
19283
|
+
}, context2), events2[index2][1]);
|
|
18326
19284
|
}
|
|
18327
19285
|
}
|
|
18328
|
-
if (
|
|
18329
|
-
const tail =
|
|
19286
|
+
if (context2.tokenStack.length > 0) {
|
|
19287
|
+
const tail = context2.tokenStack[context2.tokenStack.length - 1];
|
|
18330
19288
|
const handler = tail[1] || defaultOnError;
|
|
18331
|
-
handler.call(
|
|
19289
|
+
handler.call(context2, void 0, tail[0]);
|
|
18332
19290
|
}
|
|
18333
19291
|
tree.position = {
|
|
18334
19292
|
start: point$1(events2.length > 0 ? events2[0][1].start : {
|
|
@@ -18580,14 +19538,14 @@ function compiler(options) {
|
|
|
18580
19538
|
tail.position.end = point$1(token.end);
|
|
18581
19539
|
}
|
|
18582
19540
|
function onexitlineending(token) {
|
|
18583
|
-
const
|
|
19541
|
+
const context2 = this.stack[this.stack.length - 1];
|
|
18584
19542
|
if (this.data.atHardBreak) {
|
|
18585
|
-
const tail =
|
|
19543
|
+
const tail = context2.children[context2.children.length - 1];
|
|
18586
19544
|
tail.position.end = point$1(token.end);
|
|
18587
19545
|
this.data.atHardBreak = void 0;
|
|
18588
19546
|
return;
|
|
18589
19547
|
}
|
|
18590
|
-
if (!this.data.setextHeadingSlurpLineEnding && config.canContainEols.includes(
|
|
19548
|
+
if (!this.data.setextHeadingSlurpLineEnding && config.canContainEols.includes(context2.type)) {
|
|
18591
19549
|
onenterdata.call(this, token);
|
|
18592
19550
|
onexitdata.call(this, token);
|
|
18593
19551
|
}
|
|
@@ -35856,10 +36814,10 @@ function requireCore() {
|
|
|
35856
36814
|
endMultiClass(mode);
|
|
35857
36815
|
}
|
|
35858
36816
|
function compileLanguage(language2) {
|
|
35859
|
-
function langRe(value,
|
|
36817
|
+
function langRe(value, global2) {
|
|
35860
36818
|
return new RegExp(
|
|
35861
36819
|
source2(value),
|
|
35862
|
-
"m" + (language2.case_insensitive ? "i" : "") + (language2.unicodeRegex ? "u" : "") + (
|
|
36820
|
+
"m" + (language2.case_insensitive ? "i" : "") + (language2.unicodeRegex ? "u" : "") + (global2 ? "g" : "")
|
|
35863
36821
|
);
|
|
35864
36822
|
}
|
|
35865
36823
|
class MultiRegex {
|
|
@@ -36120,13 +37078,13 @@ function requireCore() {
|
|
|
36120
37078
|
if (ignoreIllegals === void 0) {
|
|
36121
37079
|
ignoreIllegals = true;
|
|
36122
37080
|
}
|
|
36123
|
-
const
|
|
37081
|
+
const context2 = {
|
|
36124
37082
|
code: code2,
|
|
36125
37083
|
language: languageName
|
|
36126
37084
|
};
|
|
36127
|
-
fire("before:highlight",
|
|
36128
|
-
const result =
|
|
36129
|
-
result.code =
|
|
37085
|
+
fire("before:highlight", context2);
|
|
37086
|
+
const result = context2.result ? context2.result : _highlight(context2.language, context2.code, ignoreIllegals);
|
|
37087
|
+
result.code = context2.code;
|
|
36130
37088
|
fire("after:highlight", result);
|
|
36131
37089
|
return result;
|
|
36132
37090
|
}
|
|
@@ -47869,7 +48827,7 @@ function tokenizePotentialGfmFootnoteCall(effects, ok2, nok) {
|
|
|
47869
48827
|
return ok2(code2);
|
|
47870
48828
|
}
|
|
47871
48829
|
}
|
|
47872
|
-
function resolveToPotentialGfmFootnoteCall(events2,
|
|
48830
|
+
function resolveToPotentialGfmFootnoteCall(events2, context2) {
|
|
47873
48831
|
let index2 = events2.length;
|
|
47874
48832
|
while (index2--) {
|
|
47875
48833
|
if (events2[index2][1].type === "labelImage" && events2[index2][0] === "enter") {
|
|
@@ -47907,22 +48865,22 @@ function resolveToPotentialGfmFootnoteCall(events2, context) {
|
|
|
47907
48865
|
// Take the `labelImageMarker` (now `data`, the `!`)
|
|
47908
48866
|
events2[index2 + 1],
|
|
47909
48867
|
events2[index2 + 2],
|
|
47910
|
-
["enter", call,
|
|
48868
|
+
["enter", call, context2],
|
|
47911
48869
|
// The `[`
|
|
47912
48870
|
events2[index2 + 3],
|
|
47913
48871
|
events2[index2 + 4],
|
|
47914
48872
|
// The `^`.
|
|
47915
|
-
["enter", marker,
|
|
47916
|
-
["exit", marker,
|
|
48873
|
+
["enter", marker, context2],
|
|
48874
|
+
["exit", marker, context2],
|
|
47917
48875
|
// Everything in between.
|
|
47918
|
-
["enter", string2,
|
|
47919
|
-
["enter", chunk,
|
|
47920
|
-
["exit", chunk,
|
|
47921
|
-
["exit", string2,
|
|
48876
|
+
["enter", string2, context2],
|
|
48877
|
+
["enter", chunk, context2],
|
|
48878
|
+
["exit", chunk, context2],
|
|
48879
|
+
["exit", string2, context2],
|
|
47922
48880
|
// The ending (`]`, properly parsed and labelled).
|
|
47923
48881
|
events2[events2.length - 2],
|
|
47924
48882
|
events2[events2.length - 1],
|
|
47925
|
-
["exit", call,
|
|
48883
|
+
["exit", call, context2]
|
|
47926
48884
|
];
|
|
47927
48885
|
events2.splice(index2, events2.length - index2 + 1, ...replacement);
|
|
47928
48886
|
return events2;
|
|
@@ -48100,7 +49058,7 @@ function gfmStrikethrough(options) {
|
|
|
48100
49058
|
null: [126]
|
|
48101
49059
|
}
|
|
48102
49060
|
};
|
|
48103
|
-
function resolveAllStrikethrough(events2,
|
|
49061
|
+
function resolveAllStrikethrough(events2, context2) {
|
|
48104
49062
|
let index2 = -1;
|
|
48105
49063
|
while (++index2 < events2.length) {
|
|
48106
49064
|
if (events2[index2][0] === "enter" && events2[index2][1].type === "strikethroughSequenceTemporary" && events2[index2][1]._close) {
|
|
@@ -48120,12 +49078,12 @@ function gfmStrikethrough(options) {
|
|
|
48120
49078
|
start: Object.assign({}, events2[open][1].end),
|
|
48121
49079
|
end: Object.assign({}, events2[index2][1].start)
|
|
48122
49080
|
};
|
|
48123
|
-
const nextEvents = [["enter", strikethrough2,
|
|
48124
|
-
const insideSpan2 =
|
|
49081
|
+
const nextEvents = [["enter", strikethrough2, context2], ["enter", events2[open][1], context2], ["exit", events2[open][1], context2], ["enter", text2, context2]];
|
|
49082
|
+
const insideSpan2 = context2.parser.constructs.insideSpan.null;
|
|
48125
49083
|
if (insideSpan2) {
|
|
48126
|
-
splice(nextEvents, nextEvents.length, 0, resolveAll(insideSpan2, events2.slice(open + 1, index2),
|
|
49084
|
+
splice(nextEvents, nextEvents.length, 0, resolveAll(insideSpan2, events2.slice(open + 1, index2), context2));
|
|
48127
49085
|
}
|
|
48128
|
-
splice(nextEvents, nextEvents.length, 0, [["exit", text2,
|
|
49086
|
+
splice(nextEvents, nextEvents.length, 0, [["exit", text2, context2], ["enter", events2[index2][1], context2], ["exit", events2[index2][1], context2], ["exit", strikethrough2, context2]]);
|
|
48129
49087
|
splice(events2, open - 1, index2 - open + 3, nextEvents);
|
|
48130
49088
|
index2 = open + nextEvents.length - 2;
|
|
48131
49089
|
break;
|
|
@@ -48498,7 +49456,7 @@ function tokenizeTable(effects, ok2, nok) {
|
|
|
48498
49456
|
return bodyRowData(code2);
|
|
48499
49457
|
}
|
|
48500
49458
|
}
|
|
48501
|
-
function resolveTable(events2,
|
|
49459
|
+
function resolveTable(events2, context2) {
|
|
48502
49460
|
let index2 = -1;
|
|
48503
49461
|
let inFirstCellAwaitingPipe = true;
|
|
48504
49462
|
let rowKind = 0;
|
|
@@ -48517,7 +49475,7 @@ function resolveTable(events2, context) {
|
|
|
48517
49475
|
if (token.type === "tableHead") {
|
|
48518
49476
|
afterHeadAwaitingFirstBodyRow = false;
|
|
48519
49477
|
if (lastTableEnd !== 0) {
|
|
48520
|
-
flushTableEnd(map2,
|
|
49478
|
+
flushTableEnd(map2, context2, lastTableEnd, currentTable, currentBody);
|
|
48521
49479
|
currentBody = void 0;
|
|
48522
49480
|
lastTableEnd = 0;
|
|
48523
49481
|
}
|
|
@@ -48527,7 +49485,7 @@ function resolveTable(events2, context) {
|
|
|
48527
49485
|
// Note: correct end is set later.
|
|
48528
49486
|
end: Object.assign({}, token.end)
|
|
48529
49487
|
};
|
|
48530
|
-
map2.add(index2, 0, [["enter", currentTable,
|
|
49488
|
+
map2.add(index2, 0, [["enter", currentTable, context2]]);
|
|
48531
49489
|
} else if (token.type === "tableRow" || token.type === "tableDelimiterRow") {
|
|
48532
49490
|
inFirstCellAwaitingPipe = true;
|
|
48533
49491
|
currentCell = void 0;
|
|
@@ -48541,7 +49499,7 @@ function resolveTable(events2, context) {
|
|
|
48541
49499
|
// Note: correct end is set later.
|
|
48542
49500
|
end: Object.assign({}, token.end)
|
|
48543
49501
|
};
|
|
48544
|
-
map2.add(index2, 0, [["enter", currentBody,
|
|
49502
|
+
map2.add(index2, 0, [["enter", currentBody, context2]]);
|
|
48545
49503
|
}
|
|
48546
49504
|
rowKind = token.type === "tableDelimiterRow" ? 2 : currentBody ? 3 : 1;
|
|
48547
49505
|
} else if (rowKind && (token.type === "data" || token.type === "tableDelimiterMarker" || token.type === "tableDelimiterFiller")) {
|
|
@@ -48549,7 +49507,7 @@ function resolveTable(events2, context) {
|
|
|
48549
49507
|
if (cell2[2] === 0) {
|
|
48550
49508
|
if (lastCell[1] !== 0) {
|
|
48551
49509
|
cell2[0] = cell2[1];
|
|
48552
|
-
currentCell = flushCell(map2,
|
|
49510
|
+
currentCell = flushCell(map2, context2, lastCell, rowKind, void 0, currentCell);
|
|
48553
49511
|
lastCell = [0, 0, 0, 0];
|
|
48554
49512
|
}
|
|
48555
49513
|
cell2[2] = index2;
|
|
@@ -48560,7 +49518,7 @@ function resolveTable(events2, context) {
|
|
|
48560
49518
|
} else {
|
|
48561
49519
|
if (lastCell[1] !== 0) {
|
|
48562
49520
|
cell2[0] = cell2[1];
|
|
48563
|
-
currentCell = flushCell(map2,
|
|
49521
|
+
currentCell = flushCell(map2, context2, lastCell, rowKind, void 0, currentCell);
|
|
48564
49522
|
}
|
|
48565
49523
|
lastCell = cell2;
|
|
48566
49524
|
cell2 = [lastCell[1], index2, 0, 0];
|
|
@@ -48573,9 +49531,9 @@ function resolveTable(events2, context) {
|
|
|
48573
49531
|
lastTableEnd = index2;
|
|
48574
49532
|
if (lastCell[1] !== 0) {
|
|
48575
49533
|
cell2[0] = cell2[1];
|
|
48576
|
-
currentCell = flushCell(map2,
|
|
49534
|
+
currentCell = flushCell(map2, context2, lastCell, rowKind, index2, currentCell);
|
|
48577
49535
|
} else if (cell2[1] !== 0) {
|
|
48578
|
-
currentCell = flushCell(map2,
|
|
49536
|
+
currentCell = flushCell(map2, context2, cell2, rowKind, index2, currentCell);
|
|
48579
49537
|
}
|
|
48580
49538
|
rowKind = 0;
|
|
48581
49539
|
} else if (rowKind && (token.type === "data" || token.type === "tableDelimiterMarker" || token.type === "tableDelimiterFiller")) {
|
|
@@ -48583,45 +49541,45 @@ function resolveTable(events2, context) {
|
|
|
48583
49541
|
}
|
|
48584
49542
|
}
|
|
48585
49543
|
if (lastTableEnd !== 0) {
|
|
48586
|
-
flushTableEnd(map2,
|
|
49544
|
+
flushTableEnd(map2, context2, lastTableEnd, currentTable, currentBody);
|
|
48587
49545
|
}
|
|
48588
|
-
map2.consume(
|
|
49546
|
+
map2.consume(context2.events);
|
|
48589
49547
|
index2 = -1;
|
|
48590
|
-
while (++index2 <
|
|
48591
|
-
const event =
|
|
49548
|
+
while (++index2 < context2.events.length) {
|
|
49549
|
+
const event = context2.events[index2];
|
|
48592
49550
|
if (event[0] === "enter" && event[1].type === "table") {
|
|
48593
|
-
event[1]._align = gfmTableAlign(
|
|
49551
|
+
event[1]._align = gfmTableAlign(context2.events, index2);
|
|
48594
49552
|
}
|
|
48595
49553
|
}
|
|
48596
49554
|
return events2;
|
|
48597
49555
|
}
|
|
48598
|
-
function flushCell(map2,
|
|
49556
|
+
function flushCell(map2, context2, range, rowKind, rowEnd, previousCell) {
|
|
48599
49557
|
const groupName = rowKind === 1 ? "tableHeader" : rowKind === 2 ? "tableDelimiter" : "tableData";
|
|
48600
49558
|
const valueName = "tableContent";
|
|
48601
49559
|
if (range[0] !== 0) {
|
|
48602
|
-
previousCell.end = Object.assign({}, getPoint(
|
|
48603
|
-
map2.add(range[0], 0, [["exit", previousCell,
|
|
49560
|
+
previousCell.end = Object.assign({}, getPoint(context2.events, range[0]));
|
|
49561
|
+
map2.add(range[0], 0, [["exit", previousCell, context2]]);
|
|
48604
49562
|
}
|
|
48605
|
-
const now = getPoint(
|
|
49563
|
+
const now = getPoint(context2.events, range[1]);
|
|
48606
49564
|
previousCell = {
|
|
48607
49565
|
type: groupName,
|
|
48608
49566
|
start: Object.assign({}, now),
|
|
48609
49567
|
// Note: correct end is set later.
|
|
48610
49568
|
end: Object.assign({}, now)
|
|
48611
49569
|
};
|
|
48612
|
-
map2.add(range[1], 0, [["enter", previousCell,
|
|
49570
|
+
map2.add(range[1], 0, [["enter", previousCell, context2]]);
|
|
48613
49571
|
if (range[2] !== 0) {
|
|
48614
|
-
const relatedStart = getPoint(
|
|
48615
|
-
const relatedEnd = getPoint(
|
|
49572
|
+
const relatedStart = getPoint(context2.events, range[2]);
|
|
49573
|
+
const relatedEnd = getPoint(context2.events, range[3]);
|
|
48616
49574
|
const valueToken = {
|
|
48617
49575
|
type: valueName,
|
|
48618
49576
|
start: Object.assign({}, relatedStart),
|
|
48619
49577
|
end: Object.assign({}, relatedEnd)
|
|
48620
49578
|
};
|
|
48621
|
-
map2.add(range[2], 0, [["enter", valueToken,
|
|
49579
|
+
map2.add(range[2], 0, [["enter", valueToken, context2]]);
|
|
48622
49580
|
if (rowKind !== 2) {
|
|
48623
|
-
const start =
|
|
48624
|
-
const end =
|
|
49581
|
+
const start = context2.events[range[2]];
|
|
49582
|
+
const end = context2.events[range[3]];
|
|
48625
49583
|
start[1].end = Object.assign({}, end[1].end);
|
|
48626
49584
|
start[1].type = "chunkText";
|
|
48627
49585
|
start[1].contentType = "text";
|
|
@@ -48631,24 +49589,24 @@ function flushCell(map2, context, range, rowKind, rowEnd, previousCell) {
|
|
|
48631
49589
|
map2.add(a, b, []);
|
|
48632
49590
|
}
|
|
48633
49591
|
}
|
|
48634
|
-
map2.add(range[3] + 1, 0, [["exit", valueToken,
|
|
49592
|
+
map2.add(range[3] + 1, 0, [["exit", valueToken, context2]]);
|
|
48635
49593
|
}
|
|
48636
49594
|
if (rowEnd !== void 0) {
|
|
48637
|
-
previousCell.end = Object.assign({}, getPoint(
|
|
48638
|
-
map2.add(rowEnd, 0, [["exit", previousCell,
|
|
49595
|
+
previousCell.end = Object.assign({}, getPoint(context2.events, rowEnd));
|
|
49596
|
+
map2.add(rowEnd, 0, [["exit", previousCell, context2]]);
|
|
48639
49597
|
previousCell = void 0;
|
|
48640
49598
|
}
|
|
48641
49599
|
return previousCell;
|
|
48642
49600
|
}
|
|
48643
|
-
function flushTableEnd(map2,
|
|
49601
|
+
function flushTableEnd(map2, context2, index2, table2, tableBody) {
|
|
48644
49602
|
const exits = [];
|
|
48645
|
-
const related = getPoint(
|
|
49603
|
+
const related = getPoint(context2.events, index2);
|
|
48646
49604
|
if (tableBody) {
|
|
48647
49605
|
tableBody.end = Object.assign({}, related);
|
|
48648
|
-
exits.push(["exit", tableBody,
|
|
49606
|
+
exits.push(["exit", tableBody, context2]);
|
|
48649
49607
|
}
|
|
48650
49608
|
table2.end = Object.assign({}, related);
|
|
48651
|
-
exits.push(["exit", table2,
|
|
49609
|
+
exits.push(["exit", table2, context2]);
|
|
48652
49610
|
map2.add(index2 + 1, 0, exits);
|
|
48653
49611
|
}
|
|
48654
49612
|
function getPoint(events2, index2) {
|
|
@@ -48758,9 +49716,9 @@ var roundNumber = function(num, decimal) {
|
|
|
48758
49716
|
var checkIsNumber = function(num, defaultValue2) {
|
|
48759
49717
|
return defaultValue2;
|
|
48760
49718
|
};
|
|
48761
|
-
var handleCallback = function(
|
|
49719
|
+
var handleCallback = function(context2, event, callback) {
|
|
48762
49720
|
if (callback && typeof callback === "function") {
|
|
48763
|
-
callback(
|
|
49721
|
+
callback(context2, event);
|
|
48764
49722
|
}
|
|
48765
49723
|
};
|
|
48766
49724
|
var easeOut = function(t) {
|
|
@@ -53684,8 +54642,8 @@ function PanelWithForwardedRef({
|
|
|
53684
54642
|
tagName: Type = "div",
|
|
53685
54643
|
...rest
|
|
53686
54644
|
}) {
|
|
53687
|
-
const
|
|
53688
|
-
if (
|
|
54645
|
+
const context2 = useContext(PanelGroupContext);
|
|
54646
|
+
if (context2 === null) {
|
|
53689
54647
|
throw Error(`Panel components must be rendered within a PanelGroup container`);
|
|
53690
54648
|
}
|
|
53691
54649
|
const {
|
|
@@ -53699,7 +54657,7 @@ function PanelWithForwardedRef({
|
|
|
53699
54657
|
registerPanel,
|
|
53700
54658
|
resizePanel: resizePanel2,
|
|
53701
54659
|
unregisterPanel
|
|
53702
|
-
} =
|
|
54660
|
+
} = context2;
|
|
53703
54661
|
const panelId = useUniqueId(idFromProps);
|
|
53704
54662
|
const panelDataRef = useRef({
|
|
53705
54663
|
callbacks: {
|
|
@@ -55163,7 +56121,7 @@ function PanelGroupWithForwardedRef({
|
|
|
55163
56121
|
forceUpdate();
|
|
55164
56122
|
}
|
|
55165
56123
|
}, [forceUpdate]);
|
|
55166
|
-
const
|
|
56124
|
+
const context2 = useMemo(() => ({
|
|
55167
56125
|
collapsePanel,
|
|
55168
56126
|
direction,
|
|
55169
56127
|
dragState,
|
|
@@ -55190,7 +56148,7 @@ function PanelGroupWithForwardedRef({
|
|
|
55190
56148
|
width: "100%"
|
|
55191
56149
|
};
|
|
55192
56150
|
return createElement(PanelGroupContext.Provider, {
|
|
55193
|
-
value:
|
|
56151
|
+
value: context2
|
|
55194
56152
|
}, createElement(Type, {
|
|
55195
56153
|
...rest,
|
|
55196
56154
|
children: children2,
|
|
@@ -55479,7 +56437,7 @@ const StatusBadge = ({ status }) => {
|
|
|
55479
56437
|
}
|
|
55480
56438
|
);
|
|
55481
56439
|
};
|
|
55482
|
-
const TaskDetailPanel = ({ context
|
|
56440
|
+
const TaskDetailPanel = ({ context: context2, events: events2, config }) => {
|
|
55483
56441
|
var _a;
|
|
55484
56442
|
const { theme: theme2 } = useTheme();
|
|
55485
56443
|
const [selectedTask, setSelectedTask] = useState(null);
|
|
@@ -55496,7 +56454,7 @@ const TaskDetailPanel = ({ context, actions, events: events2, config }) => {
|
|
|
55496
56454
|
return (_a2 = panelRef.current) == null ? void 0 : _a2.focus();
|
|
55497
56455
|
}
|
|
55498
56456
|
);
|
|
55499
|
-
const repoCapabilities =
|
|
56457
|
+
const repoCapabilities = context2.getRepositorySlice("repoCapabilities");
|
|
55500
56458
|
const hasClaudeWorkflow = ((_a = repoCapabilities == null ? void 0 : repoCapabilities.data) == null ? void 0 : _a.hasClaudeWorkflow) ?? false;
|
|
55501
56459
|
const handleAssignToClaude = useCallback(() => {
|
|
55502
56460
|
if (!events2 || !selectedTask) return;
|
|
@@ -56364,11 +57322,11 @@ const panels = [
|
|
|
56364
57322
|
},
|
|
56365
57323
|
component: KanbanPanel,
|
|
56366
57324
|
// Optional: Called when this specific panel is mounted
|
|
56367
|
-
onMount: async (
|
|
57325
|
+
onMount: async (context2) => {
|
|
56368
57326
|
var _a;
|
|
56369
57327
|
console.log(
|
|
56370
57328
|
"Kanban Panel mounted",
|
|
56371
|
-
(_a =
|
|
57329
|
+
(_a = context2.currentScope.repository) == null ? void 0 : _a.path
|
|
56372
57330
|
);
|
|
56373
57331
|
},
|
|
56374
57332
|
// Optional: Called when this specific panel is unmounted
|
|
@@ -56389,11 +57347,11 @@ const panels = [
|
|
|
56389
57347
|
},
|
|
56390
57348
|
component: TaskDetailPanel,
|
|
56391
57349
|
// Optional: Called when this specific panel is mounted
|
|
56392
|
-
onMount: async (
|
|
57350
|
+
onMount: async (context2) => {
|
|
56393
57351
|
var _a;
|
|
56394
57352
|
console.log(
|
|
56395
57353
|
"Task Detail Panel mounted",
|
|
56396
|
-
(_a =
|
|
57354
|
+
(_a = context2.currentScope.repository) == null ? void 0 : _a.path
|
|
56397
57355
|
);
|
|
56398
57356
|
},
|
|
56399
57357
|
// Optional: Called when this specific panel is unmounted
|