@select-org/select-post-builder 1.2.8 → 1.2.9
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 +11 -11
- package/dist/post-builder.cjs.js +47 -47
- package/dist/post-builder.js +12 -5
- package/package.json +1 -1
package/dist/post-builder.js
CHANGED
|
@@ -21804,6 +21804,7 @@ const analyticsStore = createStore((u, n) => ({
|
|
|
21804
21804
|
enabled: !1,
|
|
21805
21805
|
debug: !1,
|
|
21806
21806
|
logEventFn: null,
|
|
21807
|
+
publishCrosspost: /* @__PURE__ */ new Map(),
|
|
21807
21808
|
initialize: (d, p = {}) => {
|
|
21808
21809
|
u({
|
|
21809
21810
|
logEventFn: d,
|
|
@@ -21847,32 +21848,35 @@ const analyticsStore = createStore((u, n) => ({
|
|
|
21847
21848
|
y(p, C);
|
|
21848
21849
|
},
|
|
21849
21850
|
trackPublish: (d, p) => {
|
|
21850
|
-
const { trackEvent: m, sessionManager: g } = n(),
|
|
21851
|
-
p.status === "attempted" ? m(d, ANALYTICS_EVENTS.PUBLISH.ATTEMPTED, {
|
|
21851
|
+
const { trackEvent: m, sessionManager: g, publishCrosspost: y } = n(), b = g.getSession(d), S = p.isCrosspost ?? y.get(p.postId) ?? !1;
|
|
21852
|
+
p.status === "attempted" ? (y.set(p.postId, S), m(d, ANALYTICS_EVENTS.PUBLISH.ATTEMPTED, {
|
|
21852
21853
|
editor_type: p.editorType,
|
|
21853
21854
|
post_id: p.postId,
|
|
21854
21855
|
group_id: p.groupId,
|
|
21855
21856
|
post_type: p.postType,
|
|
21857
|
+
is_crosspost: S,
|
|
21856
21858
|
word_count: p.wordCount,
|
|
21857
21859
|
media_count: p.mediaCount,
|
|
21858
21860
|
link_count: p.linkCount,
|
|
21859
21861
|
formatting_features: p.formattingFeatures
|
|
21860
|
-
}) : p.status === "success" ? m(d, ANALYTICS_EVENTS.PUBLISH.SUCCESS, {
|
|
21862
|
+
})) : p.status === "success" ? (y.delete(p.postId), m(d, ANALYTICS_EVENTS.PUBLISH.SUCCESS, {
|
|
21861
21863
|
editor_type: p.editorType,
|
|
21862
21864
|
post_id: p.postId,
|
|
21863
21865
|
group_id: p.groupId,
|
|
21864
21866
|
post_type: p.postType,
|
|
21867
|
+
is_crosspost: S,
|
|
21865
21868
|
word_count: p.wordCount,
|
|
21866
21869
|
media_count: p.mediaCount,
|
|
21867
21870
|
link_count: p.linkCount,
|
|
21868
21871
|
formatting_features: p.formattingFeatures,
|
|
21869
21872
|
// NEW
|
|
21870
|
-
session_duration_ms:
|
|
21871
|
-
}) : (g.setLastError(d, p.failureReason || "unknown"), m(d, ANALYTICS_EVENTS.PUBLISH.FAILED, {
|
|
21873
|
+
session_duration_ms: b ? Date.now() - b.startTime : void 0
|
|
21874
|
+
})) : (y.delete(p.postId), g.setLastError(d, p.failureReason || "unknown"), m(d, ANALYTICS_EVENTS.PUBLISH.FAILED, {
|
|
21872
21875
|
editor_type: p.editorType,
|
|
21873
21876
|
post_id: p.postId,
|
|
21874
21877
|
group_id: p.groupId,
|
|
21875
21878
|
post_type: p.postType,
|
|
21879
|
+
is_crosspost: S,
|
|
21876
21880
|
error_type: p.failureReason,
|
|
21877
21881
|
word_count: p.wordCount,
|
|
21878
21882
|
media_count: p.mediaCount,
|
|
@@ -60779,6 +60783,9 @@ const PostBuilderEditorInstance = ({
|
|
|
60779
60783
|
status: "attempted",
|
|
60780
60784
|
postId: he?.postId,
|
|
60781
60785
|
postType: he?.type,
|
|
60786
|
+
// Same flag that just went into the backend payload above, so the row
|
|
60787
|
+
// says what was actually sent, not the checkbox at some earlier moment.
|
|
60788
|
+
isCrosspost: Q,
|
|
60782
60789
|
...ve
|
|
60783
60790
|
});
|
|
60784
60791
|
let be;
|
package/package.json
CHANGED